Re: JDBC parse error with preparedStatement!

Поиск
Список
Период
Сортировка
От Ramin Rad
Тема Re: JDBC parse error with preparedStatement!
Дата
Msg-id 20040111233020.71635.qmail@web9805.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: JDBC parse error with preparedStatement!  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Thanks for the suggestion. Here is the log:

LOG:  query: set datestyle to 'ISO'; select version(), case when
pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else getdatabaseencoding()
end;
LOG:  query: set client_encoding = 'UNICODE'; show autocommit
LOG:  query: DELETE FROM ft_member WHERE username = ?
ERROR:  parser: parse error at end of input
LOG:  pq_recvbuf: unexpected EOF on client connection

I don't quite know how the driver works, but shouldn't the '?' be replaced with
the variable by stmt.setString( 1, "test") before it is sent to the database?
Looks like a problem with JDBC driver.

Your help is extremely appreciated.

-ramin


--- Kris Jurka <books@ejurka.com> wrote:
>
>
> On Sun, 11 Jan 2004, Ramin Rad wrote:
>
> >
> > I am getting a very annoying parse error message on a simple delete
> statement:
> >
> >   String sqlStmt = "DELETE FROM ft_member WHERE username = ?";
> >   PreparedStatement stmt = connection.prepareStatement( sqlStmt );
> >   stmt.setString( 1, "test");
> >   stmt.executeUpdate( sqlStmt );
> >
> > Here is the error message:
> >
> > Exception in thread "main" java.sql.SQLException: ERROR:  parser: parse
> error
> > at end of input
> >
>
> I can't see anything that's going wrong here either.  The best way to
> debug this problem is to enable statement loggin on the server so we can
> see the exact query the server tries to run.  To do this enable
> log_statement in postgresql.conf and restart the server.
>
> Kris Jurka
>


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ramin Rad
Дата:
Сообщение: Re: JDBC parse error with preparedStatement!
Следующее
От: nahum castro
Дата:
Сообщение: Dreamweaver MX/jdbc