As mentioned previously, the Open SQL interface contains three classes: RWDBOSql, RWDBTBuffer<T>, and RWDBMultiRow. Here is a brief overview of how these classes work:
Class RWDBOSql encapsulates an SQL statement. The class provides facilities for:
binding both input and output buffers to the statement
executing the statement
fetching the results of the statement into the output buffers that are bound to the statement
The SQL statement may be passed in as an RWCString when the RWDBOSql is constructed, or provided later in the application. RWDBTBuffers, each representing input data or output storage, can be bound to the RWDBOSql after construction.
Class RWDBTBuffer<T> is a template class that encapsulates storage for a single element or for an array of elements of type Type, the template argument. The length of the array is set in the appropriate constructor. Alternatively, the RWDBTBuffer can create this array and manage its associated memory for you.
Along with the data array, RWDBTBuffer holds an array of null indicators. Null indicators are single values, each corresponding to a single element in your array, which indicate whether the value is NULL. An RWDBTBuffer can be used to bind an input parameter to an SQL statement, or a buffer to a result column.
Class RWDBMultiRow allows RWDBTBuffer instances, which typically represent either a single field or a column of data, to form a collection. RWDBMultiRow provides row operations on this collection, such as extracting a single row from the collection into an RWDBRow object, and producing an RWDBSchema from metadata of the collection.
In addition, RWDBMultiRow can automatically construct an RWDBTBuffer of appropriate type from an RWDBSchema; RWDBMultiRow uses the information from each column of the RWDBSchema to create a matching RWDBTBuffer. These features make RWDBMultiRow a perfect fit when integrating code written for Open SQL with code written for the existing API.
For complete technical descriptions of these classes and their functions, please consult the DBTools.h++ Class Reference.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.