Re: ResultSet.getClob() causing problems when used with JPA's @Lob - Mailing list pgsql-jdbc

From Vladimir Sitnikov
Subject Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date
Msg-id CAB=Je-EWdfRaS4X3x=txQtLKRm2rOy1xE91t=4v2cD4KtNpdmQ@mail.gmail.com
Whole thread Raw
In response to Re: ResultSet.getClob() causing problems when used with JPA's @Lob  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: ResultSet.getClob() causing problems when used with JPA's @Lob
List pgsql-jdbc
>It would be nice if someone else could point me in the right direction, because I think
that only a change to PreparedStatement would make that complete.

Am I right your problem is "find a way to identify database type at PreparedStatement#setClob time"?

I'm afraid, there's no solution for that.

Technically speaking, java types are used to parse the SQL properly.
Suppose there's a function process(int4) and function process(text). When using prepareStatement("process(?)") at java side you can refer to both of those and the exact overload depends on the setXXX method.
For instance, if you call setString, then process(text) variation will be called.

Well, let's revert to our clob/text stuff.

I'm not quite sure we can easily figure out what is the proper data type for the bind.

I do not like the idea "having additional round trip to the database just to resolve desired bind types".
I do not like the idea of having a switch that binds setClob to text or lob database types either.

Vladimir

pgsql-jdbc by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Next
From: Thomas Kellerer
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob