Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass value that contains & to preparedstatment.setString();

 
Nitya nellu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I have issue with & in prepapedstatement setString(). Can some one please suggest how to pass value that contains & character to preparedstatment.setString(1,value);


-Nitya
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Nitya!

The big advantage of PreparedStatement is that you don't have to care about special characters inside strings you want to set. So you simply use setString() exactly the way you've mentioned.

If you tried this and experienced some problems, please post your code and describe the difficulties you've encountered.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic