This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

replaceAll(String oldstring, String newstring)

 
Grégoire Berclaz
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am using JDBC and i like to insert in my MySQL DB informations but I have a probleme with "'". Because the "'" I used :
but I have every times the same error... How can I do?
Greg
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but I have every times the same error... How can I do?
What is the error that you're experiencing?
What were you expecting myJTextField.getText().replaceAll("'", "\'"); to do?
Don't forget that Strings are immutable and, if replacements are made, the replaceAll method returns a reference to a different String object than the one the method was called on.
[ July 05, 2003: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic