title: How to add a string containg a double quote to a sql database?
body: <p>I want to add a string to my sql database using JDBC. But the problem is that whenever the string contains a double quote, then the sql command is interpreted completely differently and a "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax" gets thrown."</p>
  
  <p>For example,
  String ssql = "INSERT INTO tableName VALUES (\""+ string + "\")";</p>
  
  <p>if string = "abc", then sql = INSERT INTO tableName VALUES ("abc")
  <br>
  But if string = "ab\"cd",  then sql = INSERT INTO tableName VALUES ("ab"c")
  <br>
  <br>
  <br>
  And hence for a string that contains a double quote, the sql command is interpreted completely differently.</p>
  
  <p>How can I add such a string to the database. </p>
  
  <p>PS. I cannot afford to change the double quote to a single quote. And there can be other hacks to add such a string but I want to know if there really is no such way of adding such a string directly.</p>