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.

OCCI Demonstration Programs<br />

{<br />

env->terminateConnection (conn);<br />

Environment::terminateEnvironment (env);<br />

}// end of destructor<br />

/**<br />

* displaying all the rows in the table<br />

*/<br />

void displayAllRows ()<br />

{<br />

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

"SELECT summary FROM book WHERE bookid = 11");<br />

stmt->execute ();<br />

ResultSet *rs = stmt->getResultSet ();<br />

rs->setCharacterStreamMode(1, 4000);<br />

char buffer[500];<br />

int length = 0;<br />

unsigned int size = 500;<br />

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

{<br />

Stream *stream = rs->getStream (1);<br />

while( (length=stream->readBuffer(buffer, size))!=-1)<br />

{<br />

cout

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

Saved successfully!

Ooh no, something went wrong!