Hi!
I use the BLOB.putBytes(pos, buf) method to write chunkwise from an
inputstream to a new BLOB before writing it to a database.
<sample code>
BLOB blob = BLOB.createTemporary(con, false, BLOB.DURATION_SESSION);
blob.open(BLOB.MODE_READWRITE);
byte[] binaryBuffer;
long position;
int chunkSize = 0;
int bytesRead = 0;
int bytesWritten = 0;
try {
chunkSize = blob.getChunkSize();
binaryBuffer = new byte[chunkSize];
position = 1;
while ( (bytesRead = in.read(binaryBuffer)) != -1) {
bytesWritten = blob.putBytes(position, binaryBuffer);
position += bytesRead;
}
} catch (Exception e) {
//some error handling...
}
</sample code>
This method seems to be deprecated...
what should i use instead??
greetings, arash.
HansF - 04 Nov 2005 06:42 GMT
You don't mention the version of Oracle you use. So ... I suggest you go
to the Oracle documentation for whatever version, look up the "Application
Developer's Guide - Large Objects" manual, search the table of contents
for "Using Java (JDBC) to Work with LOBs" in which they have a table
showing the JDBC 3.0 equivalent.
Docs at http://docs.oracle.com >> database + version >> View Library >>
"List of Books" link or "Books" tab >> App...

Signature
Hans Forbrich
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com
*** Top posting relies guarantees I won't respond. ***