OVERVIEW:
The Oracle Connectivity Library (OCL) is an "application framework" for programming in Oracle Call Interface (OCI). Written in C++, OCL provides much of the code necessary for manipulating data and schemas in an Oracle database. It provides a library of standard database access and retrieval functions in the form of a dynamic runtime library that can be linked in an application at runtime. This eliminates the need to embed SQL or PL/SQL within 3GL programs.
OCL allows you to create applications that use the native procedures or function calls of a C++ language to access an Oracle database server and control all phases of SQL statement execution.
All you need to do is add your application-specific code into this framework. And, given the nature of C++ class programming, it's easy to extend or override the basic functionality the OCL framework supplies.
For more information about the OCI calls, see "Oracle Call Interface Programmer's Guide", "Oracle8i Application Developer's Guide - Advanced Queuing ", and "Oracle8i Data Cartridge Developer's Guide".
All the data structures that are used by OCL are encapsulated in the form of opaque interfaces that are called handles. A handle is an opaque pointer to a storage area allocated by the OCL library that stores context information, connection information, error information, or bind information about a SQL or PL/SQL statement. A client allocates a certain type of handle, populates one or more of those handles through well-defined interfaces, and sends requests to the server using those handles. In turn, applications can access the specific information contained in the handle by using accessor functions. The OCL library manages a hierarchy of handles. Encapsulating the OCL interfaces using these handles has several benefits to the application developer including:
For an example showing the use of OCL calls for processing SQL statements, see Example1 sample program.
OCL is intended as a "call-level" SQL interface for C++. This means the focus is on executing raw SQL statements and retrieving their results. I expect that higher-level APIs will be defined as well, and these will probably be implemented on top of this base level. Examples of higher-level APIs are direct transparent mapping of tables to C++ classes, semantic tree representations of more general queries, and an embedded SQL syntax for C++, for this see Example2 simple program.
The OCL API is expressed as a series of C++ classes that allow an application programmer to open connections to particular databases, execute SQL statements, and process the results.
The most important classes are:
See the separate OCL API documents for complete documentation of OCL classes.
REQUIREMENTS:
Oracle Call Interface Library (OCI.LIB, OCIW32.LIB).
INSTALLATION:
1. Unzip the OCL ZIP file to a project directory.
USAGE:
Reference to classes and members.
OCL API Specification
CODE EXAMPLES:
This Appendix contains code examples illustrating the use
of OCL calls. These programs are provided for demonstration purposes.
Example1 - This example program demonstrates the use of C-style
functions, which are exported from OCL DLL.
Example2 - This example
program demonstrates the use of classes, which are exported from OCL DLL.