title: How to insert java.util.Date object holding date and time into mysql database
body: <p>I am using following code to insert a <code>java.util.Date</code> object in MySQL. <code>d1</code> is date object I'm getting from a function.  I tried casting <code>java.util.Date</code> into <code>java.sql.Date</code> but this doesn't save the time part.  </p>
  
  <pre><code>String sql = "INSERT INTO abc " +
                "VALUES" + "('Zara',?)";
  pstmt = conn.prepareStatement(sql);
  pstmt.setDate(1, d1);
  stmt.executeUpdate(sql);
  </code></pre>
  
  <p>Any Idea to store Date and time of Date Object in MySQL?</p>