JDBC parse error with preparedStatement!

From: Ramin Rad <ramin(at)flamenco-teacher(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: JDBC parse error with preparedStatement!
Date: 2004-01-11 18:32:50
Message-ID: 20040111183250.83080.qmail@web9806.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


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

at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at
org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:197)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:183)

I am using PostgreSql 7.3.3 and downloaded the JDBC driver in
postgresql-jdbc-7.3.3-1PGDG.i386.rpm file.

Please help, I don't understand why this is happenning, I seem to be doing
everything correctly. I doubt my table name or column names are reserved
words. They work in SELECT queries.

Thanks,
-ramin

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marcus Andree S. Magalhaes 2004-01-11 19:41:53 jdbc pooling question
Previous Message Antonio Gallardo 2004-01-10 02:05:29 Re: [BUG] - Invalid UNICODE character sequence found(0xc000)