title: Sql update query with Single quotes
body: <p>I am using hibernate application in java to retrieve and update database.</p>
  
  <p>During updating a table,i forming an sql query as follows,</p>
  
  <pre><code>String qry = "UPDATE " + entity  + " SET " + htmlColumn + " ='"+value+"' WHERE " + id + " = " + primaryId;
  </code></pre>
  
  <p><strong>where value is a html string which contains single quotes sometimes.</strong></p>
  
  <p>How to escape ignore/escape the single quotes and update the table successfully</p>
  
  <p>Thanks</p>