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.

#ifndef CPERSON_ORACLE<br />

# include "cperson.h"<br />

#endif<br />

#ifndef CSTUDENT_ORACLE<br />

# include "cstudent.h"<br />

#endif<br />

void registerMappings(oracle::occi::Environment* envOCCI_);<br />

#endif<br />

Example OCCI Application<br />

Example of <strong>C++</strong> Source File for Register Mappings: registerMappings.cpp<br />

#ifndef REGISTERMAPPINGS_ORACLE<br />

# include "registerMappings.h"<br />

#endif<br />

void registerMappings(oracle::occi::Environment* envOCCI_)<br />

{<br />

oracle::occi::Map *mapOCCI_ = envOCCI_->getMap();<br />

mapOCCI_->put("SCOTT.FULL_NAME", CFullName::readSQL,<br />

CFullName::writeSQL);<br />

mapOCCI_->put("SCOTT.ADDRESS", CAddress::readSQL, CAddress::writeSQL);<br />

mapOCCI_->put("SCOTT.PERSON", CPerson::readSQL, CPerson::writeSQL);<br />

mapOCCI_->put("SCOTT.STUDENT", CStudent::readSQL, CStudent::writeSQL);<br />

}<br />

How to Use the Object Type Translator Utility 7-103

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

Saved successfully!

Ooh no, something went wrong!