single quotation confusion - Mailing list pgsql-jdbc

From R10
Subject single quotation confusion
Date
Msg-id 1365261492317-5751065.post@n5.nabble.com
Whole thread Raw
List pgsql-jdbc
i am connecting a postgresql database to a netbeans form , and when i try to
execute a query which includes a string entered through a Jtextfield that
contain the special charachter " ' " it reads it as a single quotation
for example if a String txt = "it's cold" and to be inserted into a sql
query "insert into test values ('"+txt+"')";
it gives me
syntax error at or near "s"

any ideas how to solve that problem ??





--
View this message in context: http://postgresql.1045698.n5.nabble.com/single-quotation-confusion-tp5751065.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Publish artifacts to Maven central
Next
From: Tom Dunstan
Date:
Subject: Re: Publish artifacts to Maven central