Re: standard LOB support

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: standard LOB support
Дата
Msg-id f5fnkv$d0t$1@sea.gmane.org
обсуждение исходный текст
Ответ на Re: standard LOB support  ("EBIHARA, Yuichiro" <ebihara@iplocks.co.jp>)
Ответы Re: standard LOB support  ("EBIHARA, Yuichiro" <ebihara@iplocks.co.jp>)
Список pgsql-general
EBIHARA, Yuichiro wrote on 22.06.2007 06:09:
> It seems like PG JDBC driver CANNOT  handle 'bytea' as BLOB nor 'text' as CLOB.
> getBlob()/setBlob()/getClob()/setClob() can work with only Large Objects (at least with
> postgresql-8.1-405.jdbc3.jar).
>
> org.postgresql.util.PSQLException: Bad Integer Z\273\330x\336\335\226\243
>     at org.postgresql.jdbc1.AbstractJdbc1ResultSet.toInt(AbstractJdbc1ResultSet.java:862)
>     at org.postgresql.jdbc1.AbstractJdbc1ResultSet.getInt(AbstractJdbc1ResultSet.java:287)
>     at org.postgresql.jdbc3.Jdbc3ResultSet.getBlob(Jdbc3ResultSet.java:42)
>     at PgTest.main(PgTest.java:33)
>
> The same exception occurs when using getClob() against a text column.
>
> Using Large Objects may solve my issue but I have to note that a large object is not automatically
> deleted when the record referring to it is deleted.
>
I found that using getBinaryStream(), setBinaryStream(), getCharacterStream()
and setCharacterStream() to handle LOBs across different DBMS is much more
portable (and reliably) than using the Clob()/Blob() methods.

The Postgres JDBC driver handles the stream/writer methods just fine to read and
write text and bytea columns.

Thomas


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

Предыдущее
От: Bob Pawley
Дата:
Сообщение: Re: Excell
Следующее
От: Tom Lane
Дата:
Сообщение: Re: standard LOB support