Hello,
you can use the following code.
public String change(String str){
String st;
st="";
StringTokenizer t=new StringTokenizer(str,"'");
if(str==null)
{
st="";
}
else
{
int i =t.countTokens();
while(t.hasMoreTokens()){
if(st.compareTo("")==0)
st=t.nextToken();
else
st=st + "\\'" + t.nextToken();
}
}
return st;
}
use it as
String tempStr=rs.getString(1);
ssql= ssql + " title='" + change(tempStr) + "',";
Regards
Deepak Kumar
www.roseindia.net
----- Original Message -----
From: poornima visvesvaran <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 24, 2001 10:25 AM
Subject: error posting data which is having aphostrophy symbol
> Hi friends,
>
> I am using sql server as my backend. Servlets are my
> front end. When i try to post html data which is
> having aphostrophy (') symbol,it's giving error.
> Please help me how to remove this error. I am
> receiving data's with this symbol only.
>
> Thanks in advance.
>
> Poornima Visvesvaran.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html