title: How do I print query inside a prepared statement for SQL Server?
body: <p>I had been working with a MySQL database and a JDBC connection. In that case I could easily print a prepared statement using <code>System.out.println(ps);</code>.
  But for a SQL Server database it just prints 'SQLServerPreparedStatement' instead of the actual query that will be sent to the server after the parameters have been substituted into the SQL command. How can I accomplish that with SQL Server JDBC?I do not want to achieve that by manual coding like passing all parameters to a function and then bulding the query inside.I want to print it as soon as the query gets executed with effective parameters</p>