title: java sql date time
body: <p>When I insert a SQL <code>DateTime</code> to the database I get <code>2007-02-07 12:00:00.00</code></p>
  
  <p>But I made the <code>Date</code> object like this : <code>2007-02-07 17:29:46.00</code></p>
  
  <p>How to get the value of the seconds in the database. It always changes it back to <code>12:00:00.00</code></p>
  
  <pre><code>date.setYear(Integer.valueOf(parsedDate[2].replaceAll(" ", "")) - 1900);
  date.setMonth(Integer.valueOf(parsedDate[0].replaceAll(" ", "")));
  date.setDate(Integer.valueOf(parsedDate[1].replaceAll(" ", "")));
  ...
  java.sql.Date sqlDate = new java.sql.Date(date.getTime());
  </code></pre>
  
  <p>Should I use any formatters?</p>