Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.15 Contents of RWDBEnvironmentHandle

The access library for DB2 CLI returns an environment handle that has the type RWDBDB2CLILibEnvironmentHandle. 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.15.1 to Section 2.15.5.

Please note that connect time parameters are set only when a connection is established with the server. When a method returns a valid RWDBStatus, it doesn't 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.


NOTE: The maximum concurrent connections, connection type and sync point parameters are set at the environment level. The first connection determines the acceptable attributes for subsequent connections. DBTools.h++ establishes a default connection to the server by default when an RWDBDatabase object is produced. This means that the application must disable the default behavior by calling the static method RWDBDatabase::connect(FALSE) before producing the RWDBDatabase object in order to have desired attributes in effect.

2.15.1 Maximum Concurrent Connections

The maxConnections method sets the maximum concurrent connections for an application. Two methods are available:

The default value of 0 means that the application can set up as many connections as system resources permit. Any other value indicates a limit on the number of connections. Please refer to the Call Level Interface Guide and Reference for Common Servers (Version 2) from IBM for detailed information.

2.15.2 Connection Type

The connectType method specifies whether the application is to operate in a coordinated or uncoordinated distributed environment. Two methods are available:

The default value is SQL_CONCURRENT_TRANS, which means that applications operate inan uncoordinated distibuted environment. If the value is set to SQL_COORDINATED_TRANS processing is coordinated. Whenever processing is coordinated, you must consider the sync point setting described in Section 2.15.3, "Sync Point.". Please refer to the Call Level Interface Guide and Reference for Common Servers from IBM for detailed information.

2.15.3 Sync Point

The syncPoint method specifies whether transactions are one-phase coordinated or two-phase coordinated. Two methods are available:

The default value is SQL_ONEPHASE. The alternative value is SQL_TWOPHASE. Please refer to the Call Level Interface Guide and Reference for Common Servers (Version 2) from IBM for detailed information.

2.15.4 Login Timeout

The loginTimeout() method is not supported in DB2 CLI. It has been removed from the library.

2.15.5 Access Mode

The accessMode method sets the read/write mode for a connection. Two methods are available:

The access mode may be set to either SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE, which is the default. SQL_MODE_READ_ONLY is used by the driver to indicate that the connection is not required to support the SQL statement that causes updates to occur.

2.15.6 Foreign Keys from Views

The access library for DB2 CLI has not implemented the virtual functions:

foreignKeysFromView() and foreignKeysFromView(RWBoolean value).

Both functions are therefore no-ops which return false.

2.15.7 Using RWDBDB2CLILibEnvironmentHandle

The following example shows how to gain access to RWDBDB2CLILibEnvironmentHandle. Note that the application must be compiled with an include path to the DB2 CLI include files.

This RWDBConnection will be created with a read-only access mode. Any attempt to change the database through this connection will result in a driver error.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.