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.

occiblob.cpp<br />

build_static: $(OBJS)<br />

$(O2STATIC)<br />

OCCI Demonstration Programs<br />

# extproc_no_context and extproc_with_context are the current names of these<br />

# targets. The old names, extproc_nocallback and extproc_callback are<br />

# preserved for backward compatibility.<br />

extproc_no_context extproc_nocallback: $(OBJS)<br />

$(BUILDLIB_NO_CONTEXT)<br />

extproc_with_context extproc_callback: $(OBJS) $(LIBCLNTSH)<br />

$(BUILDLIB_WITH_CONTEXT)<br />

clean:<br />

$(RM) -f $(DEMOS) $(CPDEMOS) extdemo2 extdemo4 extdemo5 *.o *.so<br />

$(RM) -f $(OCCIDEMOS) $(OCCIOTTDEMOS) occi*m.cpp occi*o.cpp occi*.typ<br />

occiobj*.h occiinh*.h occipobj*.h<br />

$(RM) -f $(OCCIOTTDEMOSWITHMARKER) mdemo*m.cpp mdemo*o.cpp mdemo*.typ<br />

mdemo*.h<br />

$(RM) -f $(DEMOS_DP)<br />

The following code example demonstrates how to read and write aBLOB:<br />

#include <br />

#include <br />

using namespace oracle::occi;<br />

using namespace std;<br />

/**<br />

* The demo sample has starts from startDemo method. This method is called<br />

* by main. startDemo calls other methods, the supporting methods for<br />

* startDemo are,<br />

* insertRows - insert the rows into the table<br />

* deleteRows - delete the rows inserted<br />

* insertBlob - Inserts a blob and an empty_blob<br />

* populateBlob - populates a given blob<br />

* dumpBlob - prints the blob as an integer stream<br />

*/<br />

class demoBlob<br />

{<br />

private:<br />

string username;<br />

OCCI Demonstration Programs A-9

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

Saved successfully!

Ooh no, something went wrong!