Re: Backslashes in Strings being removed

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Greg Alton <greg(at)cfdev(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Backslashes in Strings being removed
Date: 2005-06-01 21:21:56
Message-ID: 20050601222156.C9013@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 01/06/2005 20:12 Greg Alton wrote:
> Hi All,
>
> How should the backslash character be excaped before storing in pgsql? I
> assumed it would be another backslach, but that doesn't seem to work and
> the backslash is dropped.
>
> My first post and excuse me if this is the wrong place or a frequently
> asked question. I did not find any posts specific to this, but many of
> you must have encountered it.

Use PreparedStatements and the driver will correctly escape it for you.

--
Paul Thomas
+------------------------------+-------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+-------------------------------------------+

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-06-01 21:37:55 Re: modification required to pass Sun's CTS
Previous Message Dave Cramer 2005-06-01 20:53:39 modification required to pass Sun's CTS