title: How to escape single quote in string literal using MySQL from Java
body: <p>I have a MySql table <code>person_details</code> which contains <code>p_id</code> and <code>p_name</code>. Now, if I want to insert a record where p_name contains a single quote <code>'</code>, I'd execute it this way-</p>
  
  <p><code>insert into person_details values (1, 'D\'souza');</code></p>
  
  <p>Now, I'm trying to execute the same through a java code this way-</p>
  
  <p><code>insert into person_details values (1, 'D\\\'souza');</code></p>
  
  <p>and I get MySQLSyntaxErrorException.</p>
  
  <p>Anything wrong?</p>