The RWDBConnection::systemHandle() method returns a pointer to a base class from which a family of implementation-specific classes are derived. To use the database API directly, an application downcasts this pointer to the appropriate type, and uses its implementation-specific features. Naturally, this usage reduces an application's portability.
For the DB Access Module for Oracle OCI, the implementation-specific system handle has the data type RWDBOCISystemHandle. It contains the OCI handles associated with the RWDBConnection. The following methods may be used to retrieve these components:
OCIError *errorHandle(); OCIEnv *ociEnvh(); OCISvcCtx *ociServerContext(); OCIServer *serverHandle();
Each RWDBConnection maintains a separate OCISvcCtx*.
RWDBOCISystemHandle offers accessors and mutators for piecewise size and maximum blob size. These functions are:
size_t piecewiseSize() const; size_t piecewiseSize(size_t size);
When fetching or sending large character or binary data (LONG, LONG RAW, CLOB, BLOB or SYS.XMLTYPE), data is sent or received in chunks of piecewiseSize() bytes at a time. Size can be reset and retrieved through piecewise size accessor and mutator. The mutator returns previously used piecewise size. The size is specified in bytes. The default piecewise size is 32768 bytes (32kb).
size_t maximumBlobSize() const; size_t maximumBlobSize(size_t newSize);
The above two methods are deprecated. The maximumBlobSize() setting is currently not used in the DB Access Module for Oracle OCI.
Prefetch rows size is used by the DB Access Module for Oracle OCI to set OCI statement attribute OCI_ATTR_PREFETCH_ROWS for every query execution. This attribute controls the number of rows an Oracle client prefetches from an Oracle server for the result set produced by the query exeution. It affects the number of server round trips and hence, performance. The default prefetch rows size used by DB Access Module for Oracle OCI is 10.
The following accessor and mutator are available from RWDBOCISystemHandle:
ub4 prefetchSize() const;
Returns the current prefetch rows size used by the DB Access Module for Oracle OCI.
ub4 prefetchSize(ub4 newSize);
Resets the prefetch rows size used by the DB Access Module for Oracle OCI to newSize. Returns the previously used prefetch rows size.
Please refer to Oracle Call Interface documentation for more information on OCI_ATTR_PREFETCH_ROWS attribute.
If it is necessary for your application to make calls directly to OCI, proceed as in the following example:
#include <rw/db/ocisrc/ocisysh.h> RWDBConnection ociConnect = myDbase.connection(); RWDBOCISystemHandle* handle = (RWDBOCISystemHandle*)ociConnect.systemHandle(); OCIEnv* env = handle->ociEnvh(); // use the OCIEnv pointer for Oracle OCI calls
Please be aware of the complications associated with making direct OCI calls, as the internal logic of the DB Access Module for Oracle OCI is not used.
Also note that your application must be compiled with an include path to the include files of the DB Access Module for Oracle OCI.
© 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.