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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example OCCI Application<br />

}<br />

delete addr2;<br />

delete student2;<br />

delete new_addr2;<br />

conn->terminateStatement(stmt);<br />

conn->terminateStatement(stmt2);<br />

/***************************************************************************/<br />

// main function of this OCCI application.<br />

// This application connects to the database as scott/tiger, creates<br />

// the Person (Joe Black) whose Address is in CA, and commits the changes.<br />

// The Person object is then retrieved from the database and its<br />

// information is displayed. A second Address object is created (in PA),<br />

// then the previously retrieved Person object (Joe Black) is moved to<br />

// this new address. The Person object is then displayed again.<br />

// The similar commands are executed for "Jill White", a Student at Stanford,<br />

// who is moved from CA to CO.<br />

/***************************************************************************/<br />

int main()<br />

{<br />

Environment *env = Environment::createEnvironment(Environment::OBJECT );<br />

/* <strong>Call</strong> the OTT generated function to register the mappings */<br />

registerMappings(env);<br />

7-114 <strong>Oracle</strong> <strong>C++</strong> <strong>Call</strong> <strong>Interface</strong> Programmer’s <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!