Oracle® C++ Call Interface Programmer's Guide 10g Release 2 (10.2) Part Number B14294-02 |
|
|
PDF · Mobi · ePub |
Table 12-1 provides a brief description of all the OCCI classes. This section is followed by detailed descriptions of each class and its methods.
Table 12-1 Summary of OCCI Classes
Class | Description |
---|---|
Represents an agent in the Advanced Queuing context. |
|
Provides methods for the Object Type Translator (OTT) utility, read and write SQL methods for linearization of objects, and conversions to and from other datatypes. |
|
Provides methods for handling batch processing errors; extends the SQLException Class. |
|
Provides access to a SQL |
|
Provides access to a SQL |
|
Examines individual bytes of a sequence for comparing bytes, searching bytes, and extracting bytes. |
|
Provides access to a SQL |
|
Represents a connection with a specific database. |
|
Represents a connection pool with a specific database. |
|
Supports dequeuing of |
|
Specifies abstraction for SQL DATE data items. Also provides formatting and parsing operations to support the OCCI escape syntax for date values. |
|
Provides an OCCI environment to manager memory and other resources of OCCI objects. An OCCI driver manager maps to an OCCI environment handle. |
|
Represents a period of time in terms of days, hours, minutes, and seconds. |
|
Represents a period of time in terms of year and months. |
|
Listens on behalf of one or more agents on one or more queues. |
|
Used to store the mapping of the SQL structured type to C++ classes. |
|
A unit that is enqueued or dequeued. |
|
Used to determine types and properties of columns in a |
|
Used to hold notification information from the Streams AQ callback function. |
|
Models the numerical datatype. |
|
When defining types, enables specification of persistent or transient instances. Class instances derived from |
|
Supports enqueuing options and enqueues |
|
The mapping in C++ for the SQL REF value, which is a reference to a SQL structured type value in the database. |
|
The mapping in C++ for the SQL REF value, which is a reference to a SQL structured type value in the database. |
|
Provides access to a table of data generated by executing an OCCI |
|
Provides information on database access errors. |
|
Represents a pool of stateless, authenticated connections to the database. |
|
Used for executing SQL statements, including both query statements and insert / update / delete statements. |
|
Used to provide streamed data (usually of the LONG datatype) to a prepared DML statement or stored procedure call. |
|
Encapsulates the information and operations necessary for registering a subscriber for notification. |
|
Specifies abstraction for SQL TIMESTAMP data items. Also provides formatting and parsing operations to support the OCCI escape syntax for time stamp values. |
OCCI classes are defined in the oracle::occi
namespace. An OCCI class name within the oracle::occi
namespace can be referred to in one of three ways:
Use the scope resolution operator (::
) for each OCCI class name.
Use the using
declaration for each OCCI class name.
Use the using
directive for all OCCI class name.
Using Scope Resolution Operator for OCCI
The scope resolution operator (::
) is used to explicitly specify the oracle::occi
namespace and the OCCI class name. To declare myConnection
, a Connection
object, using the scope resolution operator, you would use the following syntax:
oracle::occi::Connection myConnection;
The using
declaration is used when the OCCI class name can be used in a compilation unit without conflict. To declare the OCCI class name in the oracle::occi
namespace, you would use the following syntax:
using oracle::occi::Connection;
Connection
now refers to oracle::occi::Connection
, and myConnection
can be declared as Connection myConnection;
.
The using
directive is used when all OCCI class names can be used in a compilation unit without conflict. To declare all OCCI class names in the oracle::occi
namespace, you would use the following syntax:
using oracle::occi;
Then, just as with the using
declaration, the following declaration would now refer to the OCCI class Connection
as Connection myConnection;
.
Using Advanced Queuing in OCCI
The Advanced Queuing classes Producer, Consumer, Message, Agent, Listener, Subscription and NotifyResult are defined in oracle::occi::aq
namespace.
The following global methods are designed for accessing collections of Ref
s in ResultSet Class and Statement Class on Windows NT. While method names changed, the number of parameters and their types remain the same.
Use getVectorOfRefs()
in place of getVector()
on Windows NT.
Use setVectorOfRefs()
in place of setVector()
on Windows NT.
Applications on Windows NT should be calling these new methods only for retrieving and inserting collections of references. Applications not running on Windows NT can use either set of accessors. However, Oracle recommends the use of the new methods for any vector operations with Ref
s.
Collections of Refs can be fetched and inserted using methods of the following classes:
Fetching Collection of Refs Use the following version of getVectorOfRefs() to return a column of references:
void getVectorOfRefs( ResultSet *rs, unsigned int index, vector<Ref<T> > &vect);
Fetching Collection of Refs Use getVectorOfRefs() to return a collection of references from a column:
void getVectorOfRefs( Statement *stmt, unsigned int index, vector<Ref<T> > &vect);
Inserting a Collection of Refs Use setVectorOfRefs() to insert a collection of references into a column:
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> > &vect, const string &sqltype);
Inserting a Collection of Refs: Multibyte Support The following method should be used for multibyte support:
void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> > &vect, const string &schemaName, const string &typeName);
Inserting a Collection of Refs: UString (UTF16) Support The following method should be used for UString
support:
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> > &vect, const UString &schemaName, const UString &typeName);
The global methods for the fetching or inserting of collections of objects have been changed for Windows NT. The interface remains the same with respect to the method names and the number of parameters and the datatypes, but differs in the template parameter definition for Windows NT. Specifically, the template parameter for the template methods of getVector()
and setVector()
of objects (object pointers) on Windows NT have a T
instead of a T*
as shown in the following APIs.
The methods are used in the same way on different operating systems, and you don't need to modify the call to these methods. On Windows NT, the template arguments passed as object pointers in the method call are specialized for parameter T
, instead of a T*
on other operating systems.
Collections of objects can be fetched and inserted using methods of the following classes:
Fetching a Collection of objects This method fetches a collection of objects from a ResultSet
for the column specified by the index.
#ifdef WIN32COMMON template <class T> void getVector( ResultSet *rs, unsigned int index, vector< T > &vect); #else template <class T> void getVector( ResultSet *rs, unsigned int index, vector< T* > &vect); #endif
Fetching a Collection of Objects This method fetches a collection of objects from a statement for the column specified by the index. This method is used in case of OUT
binds.
#ifdef WIN32COMMON template <class T> void getVector( Statement *stmt, unsigned int index, vector< T > &vect); #else template <class T> void getVector( Statement *stmt, unsigned int index, vector< T* > &vect); #endif
Inserting a Vector of Objects This method inserts a collection of objects into a statement for the column specified by the index.
#ifdef WIN32COMMON template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T > &vect, const string &sqltype); #else template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector<T* > &vect, const string &sqltype); #endif
Inserting a Vector of Objects: Multibyte Support The following method should be used for multibyte support:
#ifdef WIN32COMMON template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T > &vect, const string &schemaName, const string &typeName); #else template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T*> &vect, const string &schemaName, const string &typeName); #endif
Inserting a Collection of Objects: UString (UTF16) Support The following method should be used for UString
support:
#ifdef WIN32COMMON template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T > &vect, const UString &schemaName, const UString &typeName); #else template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T*> &vect, const UString &schemaName, const USring &typeName); #endif