On Wed, 10 Aug 2005, David Wall wrote:
> We are converting from a 7.3 PG database to 8.0.3 and mostly all is
> working okay. We are using postgresql-8.1dev-400.jdbc3.jar for JDBC.
> Previously, we never received this sort of error. The idea is that
> certain SQLExceptions are passed to a routine in our connection pool
> that attempts to see if the Connection object is still valid or not by
> doing a simple SELECT 1 command. This command still works fine via psql.
> org.postgresql.util.PSQLException: Can''t use query methods that take a
> query string on a PreparedStatement.
> What am I doing wrong here? It seems so straightforward. We create a
> preparedStatement with a simple SELECT and then execute the query and
> ignore the result set that may come back.
The JDBC 3 Spec 13.2.4 says, "If any of the PreparedStatement execute
methods is called with an SQL string as a parameter, an SQLException is
In response to
pgsql-jdbc by date
|Next:||From: David Wall||Date: 2005-08-10 17:18:08|
|Subject: Re: PG 8.0.3 - PreparedStatement Can't Use Query Methods exception|
|Previous:||From: David Wall||Date: 2005-08-10 16:41:01|
|Subject: PG 8.0.3 - PreparedStatement Can't Use Query Methods exception |