>
It would be nice if someone else could point me in the right direction, because I thinkthat 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