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.

OCCI Demonstration Programs<br />

password = p;<br />

}<br />

void setUrl (string u)<br />

{<br />

url = u;<br />

}<br />

void runSample ()<br />

throw (SQLException)<br />

{<br />

Environment *env = Environment::createEnvironment (<br />

Environment::DEFAULT);<br />

try<br />

{<br />

Connection *conn = env->createConnection (username, password, url);<br />

Statement *stmt1;<br />

insertRows (conn);<br />

/**<br />

* Reading a populated blob & printing its property.<br />

*/<br />

string sqlQuery = "SELECT ad_composite FROM print_media WHERE product_<br />

id=6666";<br />

Statement *stmt = conn->createStatement (sqlQuery);<br />

ResultSet *rset = stmt->executeQuery ();<br />

while (rset->next ())<br />

{<br />

Blob blob = rset->getBlob (1);<br />

cout

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

Saved successfully!

Ooh no, something went wrong!