#1 2017-09-11 00:49:40

linbren
Member
Registered: 2017-08-11
Posts: 42

remote db access by firedac or or other language ?

remote db server created by TSQLDBServerHttpApi , could it be connect by firedac or other language (java ,scala, python ... ) ?


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#2 2017-09-11 00:57:45

linbren
Member
Registered: 2017-08-11
Posts: 42

Re: remote db access by firedac or or other language ?

especially other language .


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#3 2017-09-11 07:46:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: remote db access by firedac or or other language ?

As documented, TSQLDBServerHttpApi works only with a SynDB Delphi client, currently.
This is due to the optimized binary encoding used, which is tied to how SynDB works.

If you want to access remotely your database from any language, define a REST interface-based service, which will return JSON.
See e.g. "16 - Execute SQL via services".

But executing SQL directly from a remote app is not a good idea, for security (and performance) reasons.
Implementing a high-level persistence service, using high-level objects, is a better option.

Offline

#4 2017-09-11 08:01:57

linbren
Member
Registered: 2017-08-11
Posts: 42

Re: remote db access by firedac or or other language ?

{
    "fieldCount": 15, 
    "values": [
        "ID", 
        "CATEGORY_ID", 
        "TITLE", 
        "TITLE_IMG", 
        "SUMMARY", 
        "KEYWORD", 
        "IMG_CNT", 
        "CREATOR", 
        "CREATE_TIME", 
        "ORIGIN_URL", 
        "ORIGIN_AUTHOR", 
        "ORIGIN_OWNER", 
        "ORIGIN_TIME", 
        "STATUS", 
        "REMARK", 
        4, 
        66, 
        "news categroy", 
        "/upload/news/title_img/1490161680292.png", 
        "", 
        "", 
        null, 
        "admin", 
        "2017-03-22T13:48:04", 
        "", 
        "", 
        "", 
        "2017-03-22", 
        "3", 
        "", 
        10, 
        46, 
        "news", 
        "", 
        "", 
        "", 
        null, 
        "admin", 
        "2017-05-17T17:57:29", 
        "", 
        "", 
        "", 
        null, 
        "1", 
        ""
    ], 
    "rowCount": 2
}

the server return json as above , seem not a normal json format.


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

#5 2017-09-11 13:42:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: remote db access by firedac or or other language ?

This is the "non expanded" JSON format, which uses much less bandwith, and is faster to process on receiving side.
See https://synopse.info/files/html/Synopse … #TITLE_258

Offline

#6 2017-09-12 01:05:17

linbren
Member
Registered: 2017-08-11
Posts: 42

Re: remote db access by firedac or or other language ?

// initialize a TObjectList-based database engine
    aServer := TSQLRestServerFullMemory.Create(aModel,'users.json',false,true);
    try
      aServer.NoAJAXJSON:=False;
      // register our IRemoteSQL service on the server side
      aServer.ServiceRegister(TServiceRemoteSQL,[TypeInfo(IRemoteSQL)],sicClientDriven).

code from sample16 ,  NoAJAXJSON were set to false,
same result , it doesn't work.


Windows 7 64bit. Delphi XE10.2 Professional.

Offline

Board footer

Powered by FluxBB