Connecting Tech Pros Worldwide Forums | Help | Site Map

escape sequence similar to @ in C#

Newbie
 
Join Date: Apr 2009
Posts: 12
#1: May 11 '09
hi,
Does java has a escape sequence handler like @ in C#.If not how do u handle this while writing a query to access a data base.
i.e consider i have a string variable which contain ' eg: abc/efg
when i use this with the below query it throws an exception..
"SELECT * FROM DBTABLE WHERE NAME =?"

Thank you

JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: May 12 '09

re: escape sequence similar to @ in C#


Did you read the API documentation for the PreparedStatement interface?

kind regards,

Jos
Newbie
 
Join Date: Apr 2009
Posts: 12
#3: May 13 '09

re: escape sequence similar to @ in C#


Thank you for the reply.I have just shifted from c# to java.
I went through it briefly but could not find any relative information.Can u help me out??
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#4: May 13 '09

re: escape sequence similar to @ in C#


Quote:

Originally Posted by raghavv View Post

Thank you for the reply.I have just shifted from c# to java.
I went through it briefly but could not find any relative information.Can u help me out??

Go through it again and read that you can do e.g. setString(1, "abc/efg") to set the parameter value.

kind regards,

Jos
Reply

Tags
escape sequence