Re: JDBC parse error with preparedStatement!

From: Kris Jurka <books(at)ejurka(dot)com>
To: Ramin Rad <ramin(at)flamenco-teacher(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC parse error with preparedStatement!
Date: 2004-01-12 01:25:18
Message-ID: Pine.LNX.4.33.0401112023080.3834-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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
> > >

Re-reading your original message made the problem apparent. You should
just do stmt.executeUpdate(), not pass in the sqlStat which is overriding
the prepared query.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ramin Rad 2004-01-12 01:33:08 Re: JDBC parse error with preparedStatement!
Previous Message Ramin Rad 2004-01-12 00:59:01 Re: JDBC parse error with preparedStatement!