The access library for the Sybase DB-Library returns an environment handle of type RWDBSybDbLibEnvironmentHandle. This handle provides methods that an application can use to set or retrieve certain connect time and configuration parameters. The available applications are described in Section 2.13.1 to Section 2.13.13.
Please note that some connect time parameters are set only when a connection is established with the SQL server. When the method returns a valid RWDBStatus for these parameters, it does not necessarily mean that the connection parameter has been accepted by the server. Appropriate error messages will be fielded to the application only when a connection is established.
The loginTimeout() method defines the length of time in seconds that the Sybase DB-Library waits for a login response when making a connection attempt. Two loginTimout() methods are available:
int loginTimeout() const; RWDBStatus loginTimeout(int value);
According to the Sybase DB-Library manual, the default value is 60 seconds.
The timeout() method defines the length of time in seconds that the Sybase DB-Library waits for a server response when making a request. Two timeout() methods are available:
int timeout() const; RWDBStatus timeout(int value);
According to the Sybase DB-Library manual, the default is an infinite timeout period. The application can set this value at any time. It takes effect for all open connections immediately upon being called.
The defaultLanguage method defines the national language to use. Two defaultLanguage() methods are available:
RWCString defaultLanguage() const; RWDBStatus defaultLanguage(const RWCString& val);
In the Sybase DB-Library manual, the default language is us_english. The default is set using the dbsetdflang() method of the Sybase DB-Library.
Similar to the defaultLanguage method, the nationalLanguage method also defines the national language to use. Two nationalLanguage() methods are available:
RWCString nationalLanguage() const; RWDBStatus nationalLanguage(const RWCString& val);
In the Sybase DB-Library, national language is set for a particular connection using DBSETLNATLANG(). For DBSETLNATLANG() to take effect, it must be called before an RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of setting national language using DBSETLNATLANG().
The interfacesFile method defines the names of the interfaces files that are searched by the DB-Library during every call to dbopen. Two interfacesFile methods are available:
RWCString interfacesFile() const; RWDBStatus interfacesFile(const RWCString& val);
The access library makes a call to dbopen each time a new RWDBConnection is allocated. Refer to the Sybase DB-Library manuals for information on the default behavior.
The clientCharacterset method defines the client character set which gets passed to the DB-Library when an RWDBConnection is obtained. Two clientCharacterset methods are available:
RWCString clientCharacterSet() const; RWDBStatus clientCharacterSet(const RWCString& val);
For the method to take effect, it must be called before the RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of changing a client character set.
The applicationName method defines the application name that gets passed to the DB-Library when an RWDBConnection is obtained. Two applicationName methods are available:
RWCString applicationName() const; RWDBStatus applicationName(const RWCString& val);
To take effect, the method must be called before the RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of setting an application name.
The hostName method defines the host name that gets passed to the DB-Library when an RWDBConnection is obtained. Two hostName methods are available:
RWCString hostName() const; RWDBStatus hostName(const RWCString& val);
To take effect, the method must be called before the RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of setting host names.
The maximumProcs method defines the maximum limit on simultaneously open DBPROCESSes for an application. Two maximumProcs methods are available:
int maximumProcs() const; RWDBStatus maximumProcs(int value);
Each RWDBConnection is associated with a unique DBPROCESS.
The packetSize method defines the TDS packet size that gets passed to the DB-Library when an RWDBConnection is obtained. Two packetSize() methods are available:
short packetSize() const; RWDBStatus packetSize(short value);
To take effect, the method must be called before the RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of setting TDS packet sizes.
The encrypt method defines whether or not network password encryption is to be used when logging into a Sybase 10.0+ SQL server. Two encrypt() methods are available:
RWBoolean encrypt() const; RWDBStatus encrypt(RWBoolean value);
Setting the method to TRUE enables password encryption. To take effect, the method must be called before an RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the semantics of setting password encryption.
Setting the enableSecurity() method to TRUE specifies that login security labels are used for logging into a Secure SQL server. Two enableSecurity methods are available:
RWBoolean enableSecurity() const; RWDBStatus enableSecurity(RWBoolean enable);
If an application enables secured login, it must subsequently set security labels using securityLabel(). An application cannot enable secured login without setting security labels. To take effect, the enableSecurity(TRUE) must be called before an RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the complete semantics of enabling secured logins.
The securityLabels method sets login security labels for logging into a Secure SQL server.
RWDBStatus securityLabels( const RWCString& labelName, const RWCString& labelValue );
The first parameter defines the label name and the second parameter defines the label value. To take effect, the method must be called before an RWDBConnection is obtained. Refer to the Sybase DB-Library manual for the detailed semantics of label name, label value, and enabling secured logins.
The access library for Sybase DB-Library has not implemented the virtual functions:
foreignKeysFromView() and foreignKeysFromView(RWBoolean value).
Both functions are therefore no-ops which return false.
The following example shows how to gain access to the RWDBSybDbLibEnvironmentHandle. Note that the application must be compiled with an include path to the Sybase DB-Library include files.
#include <rw/db/dblibsrc/dblenvh.h> // Get correct handle by typecasting RWDBSybDbLibEnvironmentHandle *envHandle = (RWDBSybDbLibEnvironmentHandle *)aDB.environmentHandle(); // Set login time out envHandle->loginTimeout(10); // Get connection RWDBConnection conn = aDB.connection();
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.