RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDSServerClass Class

Component to specify a server-side class with published methods that can be called from a remote client using dynamic method invocation.

Pascal
TDSServerClass = class(TDSCustomServerClass);
C++
class TDSServerClass : public TDSCustomServerClass;

TDSServerClass is a component that can be used to specify a server-side class with published methods that can be called from a remote client using dynamic method invocation. 

Methods in this class can be called from remote clients, such as the DBX Client Provider or the ADO.NET provider. 

Server side classes that extend TRemoteDataModule can also be specified so that the providers they contain can be accessed by a client-side TDSProviderConnection client component.  

The parameter and return types of published server class methods supported include most of the dbExpress value types that extend from TDBXValue scalar values, TDBXReader and TStream objects. 

TDBXValue parameter types supported 

Currently, using a TDBXValue is the fastest way to pass a parameter, because these are the internal objects used to manage parameter lists. When these parameter types are specified, the internal TDBXValue is passed directly to the application. Note, however, that since this is treated as a TDBXParameterDirections.IN_OUT_PARAMETER parameter, an application may want to call TDBXWritableValue.SetNull before returning from a method where the value can be large. Otherwise the value is sent back to the remote client. 

Here is a list of TDBXValue types that can be used as parameters:

var and out scalar value types supported 

A server method's var parameters are treated as TDBXParameterDirections.IN_OUT_PARAMETER by a database client driver. A server method's out parameters are treated as TDBXParameterDirections.OUT_PARAMETER by a database client driver. 

Here are the scalar value types supported:

  • boolean
  • SmallInt
  • Integer
  • Int64
  • Single
  • Double
  • AnsiString
  • String
  • TDBXTime
  • TDBXDate

in and return scalar value types supported 

A server method's in parameter is treated as a TDBXParameterDirections.IN_PARAMETER by a database client driver. A server method's return parameter is treated as a TDBXParameterDirections.RETURN_PARAMETER by a database client driver. The return value is available to the database driver client as the last parameter in the command's parameter list. 

This list includes all of the scalar values that can be passed as var and out parameters plus the following additional data types:

Currently TBcd and TSQLTimeStamp values can only be passed using TDBXBcdValue and TDBXTimeStampValue parameters.  

Shared database connection 

A server method can share access to a database connection with a client connection. A client connection can have only one association to a server side database connection at a time. This database connection sharing with the client and server methods allows the client to execute SQL statements and SQL stored procedures using the same database connection and transactional context as the server methods that the client makes calls to. A client can share a database connection with a server method by calling a server method that returns a TDBXConnection instance. The TDBXConnection instance is not actually returned to the client. Instead, the TDBXConnection instance is used for all SQL statement and SQL stored procedure commands that are executed by the client. For convenience, this server method can be specified by setting the TDBXPropertyNames.ServerConnection connection property to the name of a server method that returns a TDBXConnection instance. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!