Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing special characters(') into oracle

 
Praveena Modugula
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to store special characters(') into oracle database?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use PreparedStatement


Shailesh
 
Praveena Modugula
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indetail explanation please...with example
Suppose if I want to insert "Sriman's" aganist name DB field...How is this achieved?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By binding the String parameter using a PreparedStatement. Change you code to use a PreparedStatement and you'll see how it works.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Praveena Modugula:
Indetail explanation please...with example
Suppose if I want to insert "Sriman's" aganist name DB field...How is this achieved?


http://www.google.com/search?q=preparedstatement+tutorial

Any of the first few results will tell you want you need to know.
 
Anand Nautiyal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try it by first replacing (') by \\' in the string
 
Eleanor Leong
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also add a "'" to your sql statment.
For e.g
insert into Restaurant (name) ('Nick''s Place');
will insert a restraurant name Nick's Place.


Eleanor Leong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic