Converting setBytes to setBlob

Поиск
Список
Период
Сортировка
От David Wall
Тема Converting setBytes to setBlob
Дата
Msg-id 004701c24d49$9f708ce0$3201a8c0@expertrade.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 7.3 Cursors/ResultSets/CallableStatements
Следующее
От: "David Wall"
Дата:
Сообщение: setBlob loop performance?