Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for Sybase CT User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.17 Contents of RWDBEnvironmentHandle

The DB Access Module for Sybase CT 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:

This pointer can be used to set or retrieve configuration parameters that are not directly supported by the environment handle.

2.17.1 Login Timeout

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:

In the Sybase Client-Library documentation, the default value is 60 seconds.

2.17.2 Timeout

The timeout() method defines the length of time in seconds that the Sybase Client-Library waits for a server response to a command:

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.

2.17.3 Application Name

The applicationName() method defines the application name that gets passed to the Sybase Client-Library when an RWDBConnection is obtained. Two applicationName() methods are available:

To take effect, the method must be called before the RWDBConnection is obtained.

2.17.4 Maximum Connections

The maximumConnections() method defines the maximum number of simultaneously open connections that an application can have:

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 Module.

2.17.5 Text Limit

The textLimit() method defines the length in bytes of the longest text or image value an application is prepared to receive:

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_options() directly.

2.17.6 Max Blob Size

The maxBlobSize() method sets the maximum size in bytes for blobs that can be fetched.

Two methods are defined:

size_t maxBlobSize() const;

RWDBStatus maxBlobSize(size_t bSize);

2.17.7 Expose Hidden Keys

The exposeHiddenKeys() method determines whether the Sybase Client-Library exposes any hidden keys that are part of a result set:

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.

2.17.8 Foreign Keys from Views

The DB Access Module for Sybase CT has not implemented the virtual functions:

Both functions are therefore no-ops, which return false.

2.17.9 No Long Char Capability

The noLongCharCapability() methods access and define the setting that will be used for the CS_DATA_NOLCHAR capability in future connections. Setting this capability to CS_TRUE disables the use of the CS_LONGCHAR client type (this is not a server side datatype).

The sybase bulk interface has problems with datatypes that expand when copied from the client to the server. This may occur when CS_DATA_NOLCHAR capability is set to CS_FALSE. Try setting the capability to CS_TRUE.

The default setting for noLongCharCapability is CS_TRUE, so connections will have the use of CS_LONGCHAR disabled. To take effect, the method must be called before the RWDBConnection is obtained.

2.17.10 CS_LOCALE Structure

Each CS_CONTEXT object has an associated CS_LOCALE structure. The CS_LOCALE structure stores the localization information that is used to process data and generate error messages by the CS_CONTEXT object and the CS_CONNECTION objects that it produces.

The CS_LOCALE structure stores values for four locale properties:

These definitions are taken from the Sybase International Developer's Guide for Open Client/Server.

The values that can be set for these properties are the vendor_locale values specified in the locales.dat file in the directory <Sybase home directory>/locales. For more details on how to use the various locale values, please see Section 2.10 in this guide and the Sybase International Developer's Guide for Open Client/Server.

The DB Access Module for Sybase CT provides three methods for accessing locales on the CS_LOCALE structure. This CS_LOCALE structure is associated with the CS_CONTEXT structure encapsulated by the RWDBSybCtLibEnvironmentHandle. Any changes on the CS_LOCALE structure are only inherited by the future CS_CONNECTION objects and do not affect the existing CS_CONNECTION objects. The three methods for accessing locales on the CS_LOCALE structure are:

RWCString localeProperty(CS_INT property) const;
void localeProperty(CS_INT property, const RWCString& value);
void locale(CS_LOCALE* locale);

2.17.11 Using RWDBSybCtLibEnvironmentHandle

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.



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.