Hi, How do you set Blob using JDBC? Essentially, my question is how do you create a Blob Object in java? I know you can setBlob() using a PreparedStatement as in - PreparedStatement ps = con.preparedStatement() ; ps.setBlob(1,Bl) -- where Bl is a blob object. How do you create this Blob object? Thanks, Shilpa.
This is how handle CLOB in Oracle (a BLOB shouldn't be that different). First you insert an empty CLOB and then select that CLOB for update. You get a Reader from you string data and write it to a Writer from the CLOB. Here a rough example
This is just an outline of the steps. You can fill in the rest. Hope this helps. Sean