title: How to print used SQL query when using PreparedStatement (JDBC)
body: <p>I used PreparedStatement in my Java program. I need to debug the SQL query because it's not working fine.</p>
  
  <p>Is there is away to print the used SQL statement with the values inserted</p>
  
  <p>for example in PreparedStatement:</p>
  
  <p>select * from table where a=?</p>
  
  <p>and than I set the ?</p>
  
  <p>could I print the used SQL, for example:</p>
  
  <p>select * from table where a=1</p>