• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

apostrophize

 
Grégoire Berclaz
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have got one error. In my form there is a JTextField and when I type a " ' " in my JTextField and try to save it in my Database I have got one error.
How could I do for saving every sentences with a " ' "?
Gr�goire
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to check for illegal characters before any update. Most databases escape the single quote with another single quote.
example:

The other other way is to use a PreparedStatement which does the escaping for you.
Jamie
 
Grégoire Berclaz
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tks, your methode was the good...
@+
Greg
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic