title: java.sql.Date formatting
body: <pre><code>public static void main(String[] args) {
      java.util.Date utilDate = new java.util.Date();
      java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
      System.out.println("utilDate:" + utilDate);
      System.out.println("sqlDate:" + sqlDate);
   }
  </code></pre>
  
  <p>I use this code part and output like this: </p>
  
  <pre><code>2013/06/14 12:06:11
  2013-06-14
  </code></pre>
  
  <p>I want the output which has date and time data. The parameter of method needs java.sql.Date format. that's why I must convert or change format of <code>sqlDate</code>. How can I solve it?</p>
  
  <p><strong>NOTE</strong></p>
  
  <pre><code>PreparedStatement insertStmt=null;
  insertStmt.setDate(parIndex, java.sql.Date);
  </code></pre>
  
  <p>That's why I want java.sql.Date format</p>