Use a preparedStatement for your INSERT.
--Shrisha
----- Original Message -----
From: "Suhas Mehta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 19, 2000 1:07 PM
Subject: Re: escaping single quotes in JSP embedded SQL
> Hi! Julia,
> Try using the escape characters like \' (backslash and a immediate
> Quote.) This is because finally when the class file is constructed it
would
> recognize it as a single quote.
>
> So far..... Enjoy Coding.....
> Suhas.
>
> -----Original Message-----
> From: Julia Reynolds [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 19, 2000 12:55 PM
> To: [EMAIL PROTECTED]
> Subject: escaping single quotes in JSP embedded SQL
>
>
> This is a basic question! When you have a SQL INSERT statement embedded
> directly in a page, and some of the insert values include single quotes,
> how in JSP
> do we handle the need to escape (double up) the single quotes to avoid
> an ODBC
> error. In VB we just replace the single quotes with two single quotes.
> Is it the same
> in JSP? Should I just append in another single quote?
>
> Julia
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets