title: SQL and Java return different dates?
body: <p>I am using sqljdbc4.jar to connect SQL Server from my java application. I have a date field in my table. It works normally when I check from Sql Server Management Studio. But in java, every date is 2 day missing.</p>
  
  <p>For example;</p>
  
  <p>my date : 2012-01-10</p>
  
  <p>date in java : 2012-01-08</p>
  
  <pre><code>PreparedStatement stmt = conn.prepareStatement("SELECT * FROM table1", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
  ResultSet rs = stmt.executeQuery();
  rs.next();
  System.out.println(rs2.getDate("dateCol").toString());
  </code></pre>
  
  <p>Why?</p>