do you believe that replacement of one char in a string with two chars costs
more than encoding the string?

David.

btw, I believe that prepared statements may solve that issue the best way,
that's in case you do not use JdbcOdbcBridge, from my experience I studied
that it doesn't update varchar fields properly, make sure it won't happen to
you.

Good luck!   :o)


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 22, 2001 11:33 AM
Subject: RE: Handling apostrophes


> Sounds like a bigger overhead than encode
>
> Dave
>
>
>
> -----Original Message-----
> From: David Treves [mailto:[EMAIL PROTECTED]]
> Sent: 22 October 2001 10:09
> To: tomcat-user
> Subject: Re: Handling apostrophes
>
>
> 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: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
> >
> >

Reply via email to