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 data type RWDBDB2CLILibSystemHandle.. It contains the SQLHDBC used by the RWDBConnection. The following method may be used to retrieve this component:
SQLHDBC hdbc() const;
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.
NOTE -- When using runtime loading of the DB2 CLI client, the SQLHDBC is not available. For information, see Section 2.18, "Using Static Libraries with DB2 CLI Access Module and MS SQL Server Module."
© 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.