Re: how to Escape single quotes with PreparedStatment - Mailing list pgsql-jdbc

From Maciek Sakrejda
Subject Re: how to Escape single quotes with PreparedStatment
Date
Msg-id CAH_hXRazM9EAOwRT18CW0hvyjoGy2xGbBneNs-PYBG8R_atZHA@mail.gmail.com
Whole thread Raw
In response to how to Escape single quotes with PreparedStatment  (JavaNoobie <vivek.mv@enzentech.com>)
List pgsql-jdbc
> However , the query fails with postgresql when a double quote is passed into
> it.I was under the impression that Prepared statement would take care of the
> same . But can anyone explain why I'm getting the error?

What do you mean by "passed into it"? There are no parameter markers
in your query. PostgreSQL/JDBC can only handle escaping of parameter
values for you if you provide them as actual parameters, rather
concatenating them into the query string.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

pgsql-jdbc by date:

Previous
From: Andrew Hastie
Date:
Subject: Re: how to Escape single quotes with PreparedStatment
Next
From: Radosław Smogura
Date:
Subject: Re: how to Escape single quotes with PreparedStatment