We are using Postgres 8.0.3, and are attempting to upgrade to the JDBC
8.x drivers, but have discovered that PreparedStatements that used to
work no longer do so. This is seen where the Java type does not match
the database type, such as attempting to use
preparedStatement.setString(1, "1") where the database type is
actually an integer (see stacktrace below). These worked fine on
previous driver versions (such as 7.4).
If we set the protocolVersion=2, the jdbc 8.x drivers will work fine
also, but I'm not so sure we really want to do that.
At first, I thought this was related to the use of server side prepares.
But I have set the prepareThreshold=0 and verified it was being set by
checking for it in the pgconnection and pgstatement, but it appears to
have no effect.
Can anyone clarify what exactly has changed with prepared statements and
why it used to work previously?
Exception in thread "main" java.sql.SQLException: ERROR: column "ticket"
is of type integer but expression is of type character varying
pgsql-jdbc by date
|Next:||From: Mark Lewis||Date: 2005-06-28 20:29:42|
|Subject: Re: OT: easiest way to create a custom PreparedStatement|
|Previous:||From: Craig Servin||Date: 2005-06-28 19:55:09|
|Subject: Re: OT: easiest way to create a custom PreparedStatement class|