Re: ResultSet.getClob() causing problems when used with JPA's @Lob
От | Vladimir Sitnikov |
---|---|
Тема | Re: ResultSet.getClob() causing problems when used with JPA's @Lob |
Дата | |
Msg-id | CAB=Je-F7KnH7ogBhsVhk0mo-KTO-WOOyX52s5DeMFspa6bKC_A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: ResultSet.getClob() causing problems when used with JPA's @Lob (Thomas Kellerer <spam_eater@gmx.net>) |
Ответы |
Re: ResultSet.getClob() causing problems when used with JPA's @Lob
|
Список | pgsql-jdbc |
1) AFAIK, Oracle allows to use getString/setString for clob columns when using Oracle JDBC driver 10.2 or higher. Basically you set SetBigStringTryClob=true connection option and that is it.
2)
Thomas>I don't think checking the column type is necessary (at least not for me).
Thomas>If this option is enabled, then all calls to getClob() are simply "re-routed" to getString().
Thomas>If this option is enabled, then all calls to getClob() are simply "re-routed" to getString().
I'm afraid you miss the point.
In postgresql world, there's "large object API": https://www.postgresql.org/docs/current/static/lo-interfaces.html
pgjdbc wraps that, so if you have a column of "oid" type, then you can access the value via getClob and pgjdbc would reroute the calls to large object API.
So getLong is not a mistake in getClob. getLong is here to retrieve the value of "large object oid" (i.e. pointer). That is why column type is crucial to tell if getClob is dealing with "large object API" or "just a string".
Vladimir
В списке pgsql-jdbc по дате отправления: