Connect to DataSnap Server (FireDAC)
Go Up to Database Connectivity (FireDAC)
This topic describes how to connect to Multi-Tier DataSnap servers.
The Multi-Tier FireDAC DataSnap driver supports:
- DataSnap servers built with RAD Studio 2007 and later.
- DataSnap clients built with RAD Studio XE2 Enterprise and later.
FireDAC statically links the Embarcadero DataSnap dbExpress driver, so no additional files and DLLs are required. Supported are RAD Studio XE2 Enterprise and later.
To link the DataSnap driver:
- drop a TFDPhysDSDriverLink component from the "FireDAC Links" palette page
- or include the FireDAC.Phys.DS unit in a uses clause.
Connection Definition Parameters
To connect to the DataSnap server, most applications require you to specify DriverID, Protocol, Server, Port, User_Name, Password (see Defining Connection (FireDAC) for details).
The protocol used to connect to the DataSnap server. It can be one of the following values:
|Server||Server address to connect to.||127.0.0.1|
|Port||The TCP/IP or HTTP port on which the DataSnap server is listening. The default value for TCP/IP is 211, for HTTP - 8080.||211|
|User_Name||DataSnap server authentication user name.|
|Password||DataSnap server authentication user password.|
|BufferKBSize||Buffer size in kilobytes to use in order to read and write operations. The default value is 32Kb.||64|
|Filters||Client filters used to store the filter configuration. The default value is empty.|
|URLPath||HTTP only. URL path used for HTTP DataSnap Service when the http protocol is used. The default value is empty.|
|DatasnapContext||HTTP only. Path toward the DS HTTP Service used to compose the URL. The current convention is: 'http://x.com/datasnap/provider/classname/method/params'. The user can change or delete the "datasnap" word from it. The default value is 'datasnap/'.|
|DSProxyHost||HTTP only. The host through which you can proxy requests, or an empty string if you do not use a proxy. The default value is empty.|
|DSProxyPort||HTTP only. The port on the proxy host through which you can proxy requests. It is ignored if DSProxyHost is not set. The default value is empty.|
|DSProxyUsername||HTTP only. User name for proxy authentication. The default value is empty.|
|DSProxyPassword||HTTP only. Password for proxy authentication. The default value is empty.|
|DSAuthenticationScheme||HTTP only. DataSnap authentication scheme. Used in conjunction with the DataSnap user name and password for authentication using the HTTP protocol. Set to "basic" in order to send User_Name / Password values using basic HTTP authentication, in addition to sending these values in the DBX connection string. Basic HTTP authentication may be used to pass credentials to an inter-process DataSnap HTTP tunnel server. The default value is empty.|
|LoginTimeout||HTTP only. Connect time-out value. The value provides the number of milliseconds the client waits for the connection to be possible. The value provides the time-out for the first server response acknowledgment rather than for the entire connect/authenticate phase. It should be used in order to avoid application freeze when it is possible to attempt connections to older DataSnap Server versions or to different applications that do not acknowledge the current communication protocol. The default value is 10000ms.|
|CommunicationTimeout||HTTP only. Time-out value in milliseconds for a response after the connection is established. The default value is empty.|
Connect to the local DataSnap server with default settings:
Connect to the DataSnap server using the TCP/IP protocol running on a local host:
DriverID=DS Protocol=tcp/ip Server=127.0.0.1 Port=211 User_Name=dsusr Password=123