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(
" stuff... \n"+
" procThatModifiesBLOB(?);\n"+
plsqlblock.setBlob(1, bl);

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?