• 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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!