23 typedef oracle::occi::Clob
Clob;
38 throw(std::runtime_error(
"Write statement not prepared"));
46 std::cout <<
"Warning from IDataItem: statement was aleady closed" << std::endl;
58 std::cout <<
"Warning from IDataItem: statement was aleady closed" << std::endl;
70 std::cout <<
"Populating the Clob using writeBuffer(Stream) method" << std::endl;
73 const char *
file = fname.c_str();
74 std::cout <<
"we are here0.5 file is:" << fname << std::endl;
79 std::cout << fname <<
" file not found\n";
82 std::string fname2 =
"/nfshome0/ecaldev/francesca/null_file.txt";
87 bufsize = inFile.tellg();
88 std::cout <<
" bufsize =" << bufsize << std::endl;
90 inFile.seekg(0, std::ios::beg);
93 char *
buffer =
new char[bufsize + 1];
97 Stream *strm = clob.getStream();
102 memset(buffer, buf, bufsize + 1);
103 inFile.read(buffer, bufsize);
104 std::cout <<
"we are here2.5" << std::endl;
106 strm->writeBuffer(buffer, strlen(buffer));
107 std::cout <<
"we are here2.6" << std::endl;
110 std::cout <<
"we are here3" << std::endl;
112 size = strlen(buffer);
113 strm->writeLastBuffer(buffer, size);
114 clob.closeStream(strm);
116 std::cout <<
"we are here4" << std::endl;
119 throw(std::runtime_error(
std::string(
"populateClob(): ") + e.getMessage()));
121 std::cout <<
"Populating the Clob - Success" << std::endl;
126 Stream *instream = clob.getStream(1, 0);
127 unsigned char *
buffer =
new unsigned char[
size];
129 memset(buffer, buf,
size);
131 instream->readBuffer((
char *)buffer,
size);
132 std::cout <<
"remember to delete the char* at the end of the program ";
137 clob.closeStream(instream);
142 throw(std::runtime_error(
std::string(
"readClob(): ") + e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::Stream Stream
unsigned char * readClob(Clob &clob, int size) noexcept(false)
void createReadStatement() noexcept(false)
virtual std::string getTable()=0
void terminateWriteStatement() noexcept(false)
void terminateReadStatement() noexcept(false)
void populateClob(Clob &clob, std::string fname, unsigned int bufsize) noexcept(false)
void setPrefetchRowCount(int ncount) noexcept(false)
oracle::occi::Statement Statement
void setConfigTag(std::string x)
oracle::occi::SQLException SQLException
std::string getConfigTag()
void checkPrepare() noexcept(false)
tuple size
Write out results.
virtual void prepareWrite() noexcept(false)=0