tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Treves" <dw...@macam.ac.il>
Subject Re: Handling apostrophes
Date Mon, 22 Oct 2001 09:08:31 GMT
Hi there,

you should simply duplicate in every input string the apostrophe.

Meaning that if the input string is:

eee'eee

after manipulating it - BEFORE inserting it to the DB it will be:

eee''eee  (  ' twice, NOT A double quote)

in the DB it will appear as SINGLE apostrophe.


That will work!  :o)
David.

----- Original Message -----
From: <dave.prout@bt.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, October 22, 2001 10:55 AM
Subject: Handling apostrophes


> Hi all,
>
> I'm developing an application which uses java servlets and JSPs and
> a MySQL database running on Tomcat 4.0.
>
> I take user input, store it on the db, then display it again. As
> soon as someone tried inputiing an apostrophe, it all fell over. It seems
> that I have to encode and decode every single text field. Is this correct,
> or is there a better way ?
>
> Thanks
>
> Dave
>
>


Mime
View raw message