title: Single Quote issue with Oracle 12 C JDBC
body: <p>I'm having an issue with a single quote being used in a query as a prepared statement. I want to look up Jack's Deli which is a value in a database column. </p>
  
  <pre><code>    String result = "Jack''s Deli"
      String sqlStatement = "select * from Restaurant where restauraunt_name like ? ";
      PreparedStatement pStmt = conn.prepareStatement(sqlStatement);
      pstmt.setString(1, result);
  </code></pre>
  
  <p>This retrieves 0 results. However, when I search directly in the database itself, using:</p>
  
  <pre><code>select * from Restaurant where restauraunt_name like 'Jack''s Deli';
  </code></pre>
  
  <p>Jack's Deli is returned. My search works fine for every other character except the single quote even when I am escaping it in Oracle by using a second single quote.</p>
  
  <p>I am thinking that the query param might be getting altered somewhere in the JDBC connection and is not being sent to the DB exactly as it is prepared (only when a single quote is involved)</p>
  
  <p>I looked into printing the param value to ensure that the DB was receiving the correct value, but it seems that is not possible in Oracle. Are there any other ways to ensure the correct param value gets passed to the DB?</p>
  
  <p>EDIT : WOW! I didn't know that the prepared statement took care of formatting, I spent all weekend trying to figure out what I was doing wrong. Thank you all so much for your advice!</p>