Re: PG 8.0.3 - PreparedStatement Can't Use Query Methods

Поиск
Список
Период
Сортировка
Искать
От
Kris Jurka
Тема
Re: PG 8.0.3 - PreparedStatement Can't Use Query Methods
Дата
Msg-id
Pine.BSO.4.56.0508101148520.20899@leary.csoft.net
Ответ на
Список
Дерево обсуждения
PG 8.0.3 - PreparedStatement Can't Use Query Methods exception David Wall <d.wall@computer.org>
Re: PG 8.0.3 - PreparedStatement Can't Use Query Methods Kris Jurka <books@ejurka.com>
Re: PG 8.0.3 - PreparedStatement Can't Use Query Methods exception David Wall <d.wall@computer.org>


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.
>         at 
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:218)
>         at 
> 
> 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 
thrown."

Kris Jurka
В списке pgsql-jdbc по дате отправления
От: David Wall
Дата:
От: David Wall
Дата:
FAQ