The DBTools.h++ Sybase CT access library returns an environment handle that has the type RWDBSybCtLibEnvironmentHandle. This handle provides methods that an application can use to set or retrieve certain connect time and configuration parameters. In addition, this handle contains the CS_CONTEXT pointer:
CS_CONTEXT* cscontext() const;
This pointer can be used to set or retrieve configuration parameters that are not directly supported by the environment handle.
The loginTimeout method defines the length of time in seconds that the Sybase Client-Library waits for a login response when making a connection attempt:
int loginTimeout() const; RWDBStatus loginTimeout(int value);
In the Sybase Client-Library documentation, the default value is 60 seconds.
The timeout method defines the length of time in seconds that the Sybase Client-Library waits for a server response when making a request:
int timeout() const; RWDBStatus timeout(int value);
In the Sybase Client-Library documentation, the default is an infinite timeout period. The application can set this value any time. It takes effect for all open connections immediately upon being called.
The maximumConnections method defines the maximum number of simultaneously open connections that an application can have:
int maximumConnections() const; RWDBStatus maximumConnections(int value);
The default value is 25, according to the Sybase Client-Library documentation. This method has no effect if the maximum number of connections being set is less than the number of currently open connections. This behavior is determined by Sybase, not the access library.
The textLimit method defines the length in bytes of the longest text or image value an application is prepared to receive:
long textLimit() const; RWDBStatus textLimit(long value);
The Sybase Client-Library will read but ignore any part of the text or image value that goes over the limit defined by this function. Refer to the Sybase Client-Library documentation for more information.
NOTE: This method affects only the client side text limit, not the server side text limit for this connection. To change the server side limit, you must call ct.option() directly.
The exposeHiddenKeys method determines whether the Sybase Client-Library exposes any hidden keys that are part of a result set:
RWBoolean exposeHiddenKeys() const; RWDBStatus exposeHiddenKeys( RWBoolean value );
Please see the Sybase Client-Library documentation for hidden keys semantics. The default behavior of the Sybase Client-Library is not to expose any hidden keys. Setting it to TRUE will change the default behavior.
The DBTools.h++ Sybase CT access library has not implemented the virtual functions:
foreignKeysFromView() foreignKeysFromView(RWBoolean value)
Both functions are therefore no-ops which return false.
The following example shows how to gain access to RWDBSybCtLibEnvironmentHandle. Note that the application must be compiled with an include path to the Sybase Client-Library include files.
#include <rw/db/ctlibsrc/ctlenvh.h> // Get correct handle by typecasting RWDBSybCtLibEnvironmentHandle *envHandle = (RWDBSybCtLibEnvironmentHandle *)aDB.environmentHandle(); // Set login time out envHandle->loginTimeout(10); // Get connection RWDBConnection conn = aDB.connection();
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.