String sqlStr ="SELECT CONTENT FROM BLOB_B WHERE id='1' FOR UPDATE";
rset = stmt.executeQuery(sqlStr);
rset.next();
blob = ( (OracleResultSet) rset).getBLOB(1);
binFile = new File(filename);
instream = new FileInputStream(binFile);
outstream = blob.getBinaryOutputStream();
byte[] chunk = new byte[blob.getChunkSize()];
int i = -1;
while ( (i = instream.read(chunk)) != -1) {
outstream.write(chunk, 0, i);
System.out.print('.');
}