title: How do I pass a Date as SQL parameter in Java without losing the time part?
body: <p>For example, I have this String: 06/10/2013 18:29:09. I want to convert this string and put it in a SQL database (as Date).</p>
  
  <p>How can I convert this to an sql date, so that it could be inserted into a database? I want the hours minutes and seconds to remain as well.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  Date javaDate = sdf.parse("06/10/2013 18:29:09");
  java.sql.Date date = new java.sql.Date(javaDate.getTime());
  </code></pre>