title: print complete query of PreparedStatement with loggers
body: <p>How to print complete query of <strong>PreparedStatement</strong> with loggers? </p>
  
  <p>Using <strong>JDBC</strong> Driver as: <strong>com.microsoft.sqlserver.jdbc.SQLServerDriver</strong></p>
  
  <pre><code>log4.properties contains
  log4j.appender.logfile=org.apache.log4j.RollingFileAppender
  log4j.appender.logfile.File=logs/ProductDataLibrary.log
  log4j.appender.logfile.MaxFileSize=10240KB
  log4j.appender.logfile.MaxBackupIndex=0
  log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
  log4j.appender.logfile.layout.ConversionPattern=%d{DATE}~ %5p ~ %C:%L ~ %x ~ %m%n
  </code></pre>
  
  <p>I have tried with <code>preparedstatement.toString()</code> method, but it is printing some @object not the complete <strong>SQL</strong> query ?</p>