use PreparedStatement
here is the example:
let's ay your DB connection object is 'dbConn'
then:
String fName="myFName";
String lName="myLName";
String query = "INSERT INTO <tableName> (FName,LName) values (?,?)";
PreparedStatement prStmt = dbConn.prepareStatement(query);
prStmt.setString(1,fName);
prStmt.setString(2,lName);
prStmt.executeUpdate();
-----------------
PreparedStatement will take care of all single quotes in varibles..
you don't have to bother...
Nishit
-----Original Message-----
From: Narayan, Karthik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 12:07 PM
To: [EMAIL PROTECTED]
Subject: single quotes and other special characters
> Hi,
>
> Is there a way to include single quotes and other special characters in an
> input field in a jsp file,
> which then gets saved into the database.
>
> Right now, I get the extra single quote which fails to submit the entries
> to the database.
>
> Thanks
>
> Karthik
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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