The RWDBConnection::systemHandle() method returns a pointer to a base class from which a family of implementation-specific classes is derived. To use the database API directly, an application can downcast this pointer to the appropriate type, and use its implementation-specific features. Naturally, this usage reduces an application's portability.
For a PostgreSQL connection, the implementation-specific system handle has the data type RWDBPGSSystemHandle. It contains the PGconn* used by the RWDBConnection. The following method may be used to retrieve this component:
PGconn* dbc()const;
To improve the performance of cursor result sets, the PostgreSQL Access Module fetches n number of rows from the server in a single call and buffers them internally. The default value of n is 10.
The number of rows fetched for cursor result sets can be altered through the following methods:
RWDBStatus rowsPerCursorFetch(unsigned long value); unsigned long rowsPerCursorFetch() const;
If it is necessary for your application to make calls directly to the PostgreSQL libpq API, proceed as in the following example:
#include <rw/db/pgssrc/pgsdefs.h> #include <rw/db/pgssrc/pgssysh.h> RWDBConnection connect = myDbase.connection(); RWDBPGSSystemHandle* handle = (RWDBPGSSystemHandle *) connect.systemHandle(); PGconn* dbc = handle->dbc(); // Use dbc for PostgreSQL libpq API calls.
© 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.