10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See Also:<br />

Developing an OCCI Object Application<br />

Developing an OCCI Object Application<br />

This section discusses the steps involved in developing a basic OCCI object<br />

application.<br />

Basic Object Program Structure<br />

■ Chapter 7, "How to Use the Object Type Translator Utility" for<br />

more information about the OTT utility<br />

The basic structure of an OCCI application that uses objects is similar to a relational<br />

OCCI application, the difference being object functionality. The steps involved in an<br />

OCCI object program include:<br />

1. Initialize the Environment. Initialize the OCCI programming environment in<br />

object mode.<br />

Your application will most likely need to include <strong>C++</strong> class representations of<br />

database objects in a header file. You can create these classes by using the Object<br />

Type Translator (OTT) utility, as described in Chapter 7, "How to Use the Object<br />

Type Translator Utility".<br />

2. Establish a Connection. Use the environment handle to establish a connection to<br />

the database server.<br />

3. Prepare a SQL statement. This is a local (client-side) step, which may include<br />

binding placeholders. In an object-relational application, this SQL statement<br />

should return a reference (REF) to an object.<br />

4. Access the object.<br />

a. Associate the prepared statement with a database server, and execute the<br />

statement.<br />

b. By using navigational access, retrieve an object reference (REF) from the<br />

database server and pin the object. You can then perform some or all of the<br />

following:<br />

* Manipulate the attributes of an object and mark it as dirty (modified)<br />

* Follow a reference to another object or series of objects<br />

* Access type and attribute information<br />

* Navigate a complex object retrieval graph<br />

Object Programming 3-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!