The RWDBConnection::systemHandle() method returns a pointer to a base class from which a family of implementation-specific classes is derived. Applications that wish to use the DB2 CLI directly can downcast this pointer to the appropriate type, and use its implementation-specific features. Naturally, this style of use reduces an application's portability.
In the case of an DB2 connection, the implementation-specific system handle has the datatype RWDBDB2CLILibSystemHandle. It contains the RWDBHDBC used by the RWDBConnection. The following method may be used to retrieve this component:
RWDBHDBC hdbc();
If it is necessary for your application to make calls directly to the DB2 CLI, proceed as in the following example:
#include <sqlcli1.h> #include <rw/db/db2clisrc/db2sysh.h> RWDBConnection connection = myDbase.connection(); RWDBDB2CLILibSystemHandle* handle = (RWDBDB2CLILibSystemHandle *)connection.systemHandle(); SQLHDBC hdbc = handle->hdbc(); // Use hdbc for DB2 CLI calls.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.