Overcomplicated oracle jdbc BLOB handling
问题 When I search the web for inserting BLOBs into Oracle database with jdbc thin driver, most of the webpages suggest a 3-step approach: insert empty_blob() value. select the row with for update . insert the real value. This works fine for me, here is an example: Connection oracleConnection = ... byte[] testArray = ... PreparedStatement ps = oracleConnection.prepareStatement( "insert into test (id, blobfield) values(?, empty_blob())"); ps.setInt(1, 100); ps.executeUpdate(); ps.close(); ps =