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.
In the case of an Microsoft SQL Server connection, the implementation-specific system handle has the datatype RWDBMsSqlLibSystemHandle. It contains the SQLHDBC used by the RWDBConnection. The following method may be used to retrieve this component:
SQLHDBC hdbc();
If it is necessary for your application to make calls directly to the Microsoft SQL Server ODBC API, proceed as in the following example:
#include <rw/db/msqsrc/msqsysh.h> RWDBConnection conn = myDbase.connection(); RWDBMsSqlLibSystemHandle* handle = (RWDBMsSqlLibSystemHandle *) conn.systemHandle(); SQLHDBC sqlhdbc = handle->hdbc(); // Use sqlhdbc for MS SQL Server ODBC API calls.
The RWDBMsSqlLibSystemHandle class allows the user to specify a given type of cursor. The cursor types that can be set are:
SQL_CURSOR_KEYSET_DRIVEN SQL_CURSOR_STATIC SQL_CURSOR_FORWARD_ONLY SQL_CURSOS_DYNAMIC
The default value is SQL_CURSOR_KEYSET_DRIVEN.
To determine the cursor type, use function:
SQLUINTEGER cursorType() const;
To set the cursor type, use function:
RWDBStatus cursorType(SQLUINTEGER val);
The RWDBMsSqlLibSystemHandle class allows the user to specify whether or not large Blob inserts and updates should be recorded in the transaction log.
To return the current setting, use function:
RWBoolean logTextUpdates() const;
To specify whether such updates should be recorded in log, use function:
RWDBStatus logTextUpdates(RWBoolean val);
The default value is TRUE.
The default size of text or images that can be returned by an SQL Server is set to the maximum of 2GB by the Microsoft SQL Server ODBC driver. To limit the amount of text that can be retrieved, an application must change the default size.
To return the current size setting, use function:
SQLUINTEGER textSize() const;
To specify a new size, use function:
RWDBStatus textSize(SQLUINTEGER size);
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.