unterminated quoted string

From: "Alexey Yudichev" <Alexey(at)francoudi(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: unterminated quoted string
Date: 2003-04-14 06:29:59
Message-ID: 8BCBF9DB739F034B87FE7C7D30EAE55C157C4E@hqex2k.francoudi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pedro Salazar 2003-04-14 09:25:54 Re: tomcat/postgres problem
Previous Message Tom Lane 2003-04-14 05:44:05 Re: Problem about pgsql's column alias