title: MySQL or Tomcat log query
body: <p>I am having trouble with a particular query, it runs perfectly well in SQLYog but not in my JSP page. I get no results in my JSP page and I also get no errors either, but again if I run the same query direct on the database I get the expected results.</p>
  
  <p>I would like to be able to see what query is trying to be sent to the MySQL server, then hopefully I can figure what maybe going astray. Can this be done?</p>
  
  <p>I am using MySQL Server 5.5 for Windows 64bit, Tomcat 7 for Windows 64bit and my connection class is as follows:</p>
  
  <pre><code>public static Connection getConnection()
  {
      settings settings1 = new settings();
      Connection connection = null;
      try
      {
          Class.forName("com.mysql.jdbc.Driver").newInstance();
          connection = DriverManager.getConnection("jdbc:mysql://" + dbHost + "/" + settings1.db + "?useUnicode=true&amp;characterEncoding=UTF-8", settings1.dbUsername, settings1.dbPassword);
      }
      catch(Exception exception)
      {
          exception.printStackTrace();
      }
      return connection;
  }
  </code></pre>
  
  <p>Any help to enable logging would be much appreciated :-)</p>
  
  <p>The query is as follows:</p>
  
  <pre><code>SELECT product.ID, product.partCodePS, product.partCodeManufacturer, product.pName, product.priceCost, product.priceSell, product.reorderLevel, product.location, brand.leadTime, SUM(order_product.unitPrice)
  FROM product
  INNER JOIN order_product ON (product.ID = order_product.productID)
  INNER JOIN brand ON (product.brandID = brand.ID)
  INNER JOIN order ON (order_product.orderID = order.ID)
  WHERE (product.isWebsite =1 AND order.o_statusID IN (1,2,3,4,5,11,12,14,15))
  GROUP BY order_product.unitPrice
  </code></pre>