title: Entering a Date value in Postgresql with Java
body: <p>I am trying to program a database application with java &amp; PostgreSQL. I have some rows with date data type. But i cant add any entries to the database with this code :</p>
  
  <pre><code>Date aDate = null;
  aDate.setYear(1990);
  aDate.setDate(01);
  aDate.setMonth(05);
  
  preparedStatement prep = connection.prepareStatement("insert 
  into exampletable values (?,?);");
  prep.setDate(1, (java.sql.Date) aDate);
  prep.setDate(2, (java.sql.Date) aDate);
  </code></pre>
  
  <p>How can i add a date in a postgreSQL row with queries in java?</p>