Re: Escaping strings?

From: Timothy Reaves <treaves(at)silverfields(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Escaping strings?
Date: 2002-11-04 02:35:12
Message-ID: 20021103213512.186d263b.treaves@silverfields.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Unfortunatly I can not do that, as the entire sql string is dynamically
generated. Is there no parseString() or escapeString() method? If not,
what charachers need escaping?

Thanks!

On 04 Nov 2002 11:14:00 +0900
"Thomas O'Dowd" <tom(at)nooper(dot)com> wrote:

> Use the setString() method of PreparedStatement and it will escape
> things for you.
>
> Tom.
>
> On Mon, 2002-11-04 at 11:06, Timothy Reaves wrote:
> > What is the proper way to insure a text string (i.e. one read from
> > a
> > JTextField.getText()) is propery escaped? I assumed the JDBC driver
> > would do this automatically, but it does not. An ' character will
> > cause the JDBC driver to throw an exception.
> >
> > ---------------------------(end of
> > broadcast)--------------------------- TIP 5: Have you checked our
> > extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
> --
> Thomas O'Dowd, CEO, Nooper.com - Mobile Services Inc., Tokyo, Japan
> i-mode & FOMA consulting, development, testing: http://nooper.co.jp/
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas O'Dowd 2002-11-04 02:52:50 Re: Escaping strings?
Previous Message Thomas O'Dowd 2002-11-04 02:14:00 Re: Escaping strings?