
October 8th, 2003, 09:25 AM
|
|
Junior Member
|
|
Join Date: Sep 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
retrieving temporary BLOB from PLSQL to Java ?
I am trying to pass a temporary BLOB that I've created in Java, to a
PLSQL function that modifies it, and then to retrieve this modified
value back to Java, all using JDBC.
I can't figure out how to get the modified BLOB object back to Java
after the PLSQL block has finished executing.
I do:
BLOB bl = BLOB.createTemporary(db,true,BLOB.DURATION_SESSION);
CallableStatement plsqlblock = conn.prepareCall(
"declare\n"+
" stuff... \n"+
"begin\n"+
" procThatModifiesBLOB(?);\n"+
"end;\n");
plsqlblock.setBlob(1, bl);
plsqlblock.execute();
bl = plsqlblock.getBlob(1); //**** doesn't work.
The last line in my code throws an exception saying that the column index is invalid. When I remove this line, I get an exception saying "nonexistent LOB value". I know that the lob value does exist, because if I use a regular BLOB in a table, it works.
How do I retrieve the modified value of "bl" after "plsqlblock"
finishes executing?
|