Hi  Kishore Raghavan:
    i'm tried the method you offered. it was correct for  a text  tag,
but it wasn't  correct for  a  textarea tag
in a form.how can i  make code for the  textarea tag.
eg:
    <textarea name=txtquestion>something with quote</textarea>

String getStr=request.getParameter("txtquestion");
String SQLstr="insert into table values('" + getStr +"')";
its get SQLException "comma wanting";
   please help me to solve this question!!

----- Original Message -----
From: Kishore Raghavan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 05, 2000 5:51 PM
Subject: Re: how to insert a filed consisting of single quote in msaccess?


> Wensj,
>
> You do lot of effort in getting rid of characters like quotes etc... How
> many such characters will you keep replacing ???
>
> Use PreparedStatements in your inserts. All your problems will get solved
> automatically. Tap the power of JDBC please
>
> Kishore Raghavan
>
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of wensj
> Sent: Monday, June 05, 2000 2:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: how to insert a filed consisting of single quote in
> msaccess?
>
>
> hi:
>     i'm met this question,this because your text field include character
> "\'".
> in SQL statement,it's look as separater.
>    eg: when you insert "b'day" as the third field into table.
> SQL statement is:    insert into table values('aa','bb','b'day'.....)
>     at this time, it cause SQLException: "comma wanting";
>     how can we aviod this problem?
>     i'm througth two ways
>     one is: not permit input "\'" at text field.
>     the other is: before insert,use other character replace it.
>     eg:
>    <%     String tmpstr=request.getParameter("strwithspe");
>         tmpstr=tmpstr.replace("\'","~");
> %>
>     user "~" replace "\'",
>     when you get data from database,you must replace character "~" with
> "\'".
>
>                                                                     ok?
>
> ----- Original Message -----
> From: Kotireddy Mutyam <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 05, 2000 3:56 PM
> Subject: how to insert a filed consisting of single quote in msaccess?
>
>
> > hi friends,
> > I am working on JSP using JRun with MSAccess as a Database.
> > I am not able to insert a field for example if i enter the value in text
> >       field like "b'day" it is throwing exception. How to overcome the
> >       error?
> > TIA
> > kotireddy
> > [EMAIL PROTECTED]
> >
> >
> ===========================================================================
> > 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

===========================================================================
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

Reply via email to