Re: ResultSet.getClob() causing problems when used with JPA's @Lob

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date: 2016-07-28 20:47:28
Message-ID: CAB=Je-EWdfRaS4X3x=txQtLKRm2rOy1xE91t=4v2cD4KtNpdmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2016-07-28 21:07:56 Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Previous Message Thomas Kellerer 2016-07-28 20:46:22 Re: ResultSet.getClob() causing problems when used with JPA's @Lob