title: How to store time from java.util.Date into java.sql.Date
body: <p>I want to convert <code>java.util.Date</code> to <code>java.sql.Date</code> but I want hours, minutes, and seconds as well but java.sql.Date can be used only to store date(no time) . I tried the below code but it is giving only year, month, and day for the <code>java.sql.Date</code> object.</p>
  
  <pre><code>SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
  Date parsed = format.parse("20110210120534");
  System.out.println(format.parse("20110210120534"));
  java.sql.Date sql = new java.sql.Date(parsed.getTime());
  System.out.println("SQL date is= "+sql);
  </code></pre>
  
  <p>Current output:</p>
  
  <pre><code>2011-02-10
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>2011-02-10 12:05:34
  </code></pre>