Re: Bug with blobs?

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Bug with blobs?
Дата
Msg-id Pine.BSO.4.62.0508111334440.10158@leary.csoft.net
обсуждение исходный текст
Ответ на Bug with blobs?  (Rob Kirkbride <rob@rkcomputing.co.uk>)
Ответы Re: Bug with blobs?  (Rob Kirkbride <rob@rkcomputing.co.uk>)
Список pgsql-jdbc

On Thu, 11 Aug 2005, Rob Kirkbride wrote:

> I was getting an exception thrown when using Hibernate to read blobs but
> I've pared it down to something very simple - hopefully it's just
> something silly.
>
>           String query = "select imageblob from tempimages where id=1";
>
>                   java.sql.Blob blob = rs.getBlob("imageblob");
>
> It throws a
> org.postgresql.util.PSQLException: Bad value for type int :
> \377\330\377\340\000 .... <blob data removed>
>   at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2528)
>   at

Postgresql maps Blob data to the oid datatype, not bytea.  For bytea data
you should use getBytes() not getBlob.

Kris Jurka

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Rob Kirkbride
Дата:
Сообщение: Bug with blobs?
Следующее
От: Mark Lewis
Дата:
Сообщение: Re: Memory leak in 8.0 JDBC driver?