• Post Reply Bookmark Topic Watch Topic
  • New Topic

quotation mark problem

 
Caven Wang
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to input a sentence ( I'll say," you story is interesting." ) into my database. But the quotation mark always brings me trouble. without the quotation marks, it executes well. How to replace teh quotation mark? will you give an simple example for my better understand? Thank you in advance!
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try escaping the quotation marks like this:
I'll say, \"you story is interesting.\"
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use a PreparedStatement to insert it into the database, instead of a normal Statement.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!