Re: Jdbc4ResultSet getClob and getBlob are calling getLong internally
От
Kris Jurka
Тема
Re: Jdbc4ResultSet getClob and getBlob are calling getLong
internally
Дата
Msg-id
alpine.BSO.2.00.1002011512140.30625@leary.csoft.net
Ответ на
Список
Дерево обсуждения
Jdbc4ResultSet getClob and getBlob are calling getLong internally Nedim Cholich <nedim@cholich.com>
Re: Jdbc4ResultSet getClob and getBlob are calling getLong
internally Kris Jurka <books@ejurka.com>
Re: Jdbc4ResultSet getClob and getBlob are calling getLong
internally Nedim Cholich <nedim@cholich.com>
Re: Jdbc4ResultSet getClob and getBlob are calling
getLong internally "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Jdbc4ResultSet getClob and getBlob are calling getLong
internally Kris Jurka <books@ejurka.com>
Re: Jdbc4ResultSet getClob and getBlob are calling getLong
internally Nedim Cholich <nedim@cholich.com>
On Mon, 1 Feb 2010, Nedim Cholich wrote:
> After getting 'org.postgresql.util.PSQLException: Bad value for type
> long' I found these two methods in Jdbc4ResultSet:
>
> public java.sql.Clob getClob(int i) throws SQLException
> {
> return new Jdbc4Clob(connection, getLong(i));
> }
>
> Calling getLong here has to be wrong?
>
No. Large Objects are not stored directly inline, but as a pointer to
other storage. The getLong is retrieving the external storage which
Jdbc4Clob will then stream from the server on demand. You are probably
trying to call getClob on a text or varchar column and that's not going to
work. It might be nice to provide that interface, but there's no benefit
(other than compatibility) to the user. If you have text data stored
inline, then it's already been transferred over to the client side in the
ResultSet, so there's no point in using a streaming interface.
Kris Jurka
В списке pgsql-jdbc по дате отправления
От: Nedim Cholich
Дата:
От: Nedim Cholich
Дата: