SourcePro® API Reference Guide

 
List of all members | Public Member Functions

Provides a mechanism for making direct calls to the Sybase Open Client Client-Library API and some methods for setting access module-specific properties. More...

#include <rw/db/ctlibsrc/ctlsysh.h>

Inheritance diagram for RWDBSybCtLibSystemHandle:
RWDBSystemHandle

Public Member Functions

CS_CONNECTION * csconn () const
 
CS_CONTEXT * cscontext () const
 
bool logTextUpdates () const
 
RWDBStatus logTextUpdates (bool value)
 
long rowsPerCursorFetch () const
 
RWDBStatus rowsPerCursorFetch (long value)
 

Detailed Description

Class RWDBSybCtLibSystemHandle provides methods for setting and retrieving options that affect performance. It also contains the CS_CONTEXT pointer used by the RWDBDatabase, and the CS_CONNECTION pointer used by the RWDBConnection.

Note
Use of this class reduces an application's portability.

Sybase Client-Library uses the CS_CONTEXT structure as a parent structure for the application, the CS_CONNECTION structure as a handle to the server, and the CS_COMMAND structure for defining and executing commands.

The DB Interface Module uses a single CS_CONTEXT structure for each RWDBDatabase instance. This structure is allocated when the RWDBDatabase is instantiated, and destroyed when the instance goes out of scope.

The CS_CONNECTION structure is opened and closed as needed for RWDBConnection instances. Each RWDBConnection corresponds to an open CS_CONNECTION structure.

Each cursor is associated with a unique CS_COMMAND structure to facilitate multiple cursors on a single connection.

Note
The function cscommand() was removed in the DB Access Module for Sybase. If your application depends on this method, please consult Rogue Wave Support Services for alternate ways to achieve the same results.
Synopsis
#include <rw/db/ctlbisrc/ctlsysh.h>
(RWDBSybCtLibSystemHandle*)myConnection.systemHandle();
Example

This example shows how to make calls directly to the Sybase Open Client by getting the property CS_TEXTLIMIT that is associated with the CS_CONNECTION. Note that the application must be compiled with an include path to the Sybase Open Client include files.

Note
Some properties cannot be set once a context, connection, or command is established. Refer to the Sybase Open Client documentation for more information.
#include <rw/db/ctlibsrc/ctlsysh.h>
RWDBConnection aConnection = aDb.connection();
RWDBSystemHandle* aHandle = aConnection.systemHandle();
CS_CONNECTION *csconn = ctLibHandle->csconn();
CS_INT limit, outlen;
ct_con_props(csconn, CS_GET, CS_TEXTLIMIT, &limit, CS_UNUSED, &outlen);

Member Function Documentation

CS_CONNECTION * RWDBSybCtLibSystemHandle::csconn ( ) const
inline

Returns a pointer to the CS_CONNECTION structure used for client library calls. Each RWDBConnection corresponds to an open CS_CONNECTION structure.

CS_CONTEXT * RWDBSybCtLibSystemHandle::cscontext ( ) const
inline

Returns a pointer to the CS_CONTEXT structure used by the RWDBDatabase.

A single CS_CONTEXT structure is maintained for each RWDBDatabase instance. This structure is allocated when the RWDBDatabase is instantiated, and destroyed when the instance goes out of scope.

bool RWDBSybCtLibSystemHandle::logTextUpdates ( ) const
inline

Returns true if the client library is to log updates to text and image columns. This behavior is enabled by default.

RWDBStatus RWDBSybCtLibSystemHandle::logTextUpdates ( bool  value)
inline

Changes the behavior for logging updates to text and image columns, and returns an RWDBStatus indicating whether the operation was successful. Passing a value of false disables logging updates. The default is true.

long RWDBSybCtLibSystemHandle::rowsPerCursorFetch ( ) const
inline

Returns the number of rows to be fetched for cursor result sets. The default value is 10.

RWDBStatus RWDBSybCtLibSystemHandle::rowsPerCursorFetch ( long  value)
inline

Sets the number of rows to be fetched for cursor result sets, and returns an RWDBStatus indicating whether the operation was successful.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.