Converting setBytes to setBlob

From: "David Wall" <dwall(at)Yozons(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Converting setBytes to setBlob
Date: 2002-08-26 21:43:32
Message-ID: 004701c24d49$9f708ce0$3201a8c0@expertrade.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2002-08-26 22:16:30 setBlob loop performance?
Previous Message Bruce Momjian 2002-08-26 16:20:29 Re: 7.3 Cursors/ResultSets/CallableStatements