JDBC parse error with preparedStatement! - Mailing list pgsql-jdbc

From Ramin Rad
Subject JDBC parse error with preparedStatement!
Date
Msg-id 20040111183250.83080.qmail@web9806.mail.yahoo.com
Whole thread Raw
Responses Re: JDBC parse error with preparedStatement!  (Kris Jurka <books@ejurka.com>)
List 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


pgsql-jdbc by date:

Previous
From:
Date:
Subject: Multi-dimensional array support
Next
From: "Marcus Andree S. Magalhaes"
Date:
Subject: jdbc pooling question