title: How to insert DATE type in PostgreSql using Java?
body: <p>I have a column of date type (daterecord) in PostgreSql and jdatechooser component in java (dateChooser). I am trying to insert the selected date into my database with this initial code:</p>
  
  <pre><code>Date daterec = dateChooser.getDate();
  String sql= "INSERT INTO date values (?)";
  pst.prepareStatement(sql);
  pst.setDate(1, daterec);
  pst.execute();
  </code></pre>
  
  <p>..but I know my setDate code is wrong..please help what to do?</p>