Thread: Converting setBytes to setBlob

Converting setBytes to setBlob

From
"David Wall"
Date:
I have a byte array that had been inserted into a OID in 7.1.  I used
PreparedStatement.setBytes() for this.

In 7.2, I'd need to convert this use the PreparedStatement.setBlob() method
instead.

Is there a commonly used way to convert a byte array into a Blob for the use
of the API?  It seems that the API is designed easier for reading a blob,
since there's a Blob.getBytes().

Does everybody really have to create their own classes and implement the
java.sql.Blob interface in order to get data into the database?  It's odd
because you wouldn't think we'd need to do something special to insert a
blob, especially in terms of implementing a JDBC interface.

David