unterminated quoted string - Mailing list pgsql-jdbc

From Alexey Yudichev
Subject unterminated quoted string
Date
Msg-id 8BCBF9DB739F034B87FE7C7D30EAE55C157C4E@hqex2k.francoudi.com
Whole thread Raw
Responses Re: unterminated quoted string
List pgsql-jdbc
Having the code

      String SQL = "SELECT COUNT(*) FROM Destination WHERE address=?";
      st = conn.prepareStatement(SQL);
      st.setString(1, address);
      rs = st.executeQuery();

and if address is an empty string, sometimes (very rarely) i get

java.sql.SQLException: ERROR:  Unterminated quoted string

        at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
        at org.postgresql.Connection.ExecSQL(Connection.java:398)
        at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
        at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
        at org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)

I use PostgreSQL 7.1 and PostgreSQL 7.2 driver with "compatible=7.1" option.


pgsql-jdbc by date:

Previous
From: "Jason Dinger"
Date:
Subject: Fixed: tomcat/postgres problem
Next
From: Pedro Salazar
Date:
Subject: Re: tomcat/postgres problem