Converting setBytes to setBlob - Mailing list pgsql-jdbc

From David Wall
Subject Converting setBytes to setBlob
Date
Msg-id 004701c24d49$9f708ce0$3201a8c0@expertrade.com
Whole thread Raw
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 7.3 Cursors/ResultSets/CallableStatements
Next
From: "David Wall"
Date:
Subject: setBlob loop performance?