title: Java - creating an oracle date field
body: <p>I have an Oracle <code>Date</code> type to which I need to insert the current date.</p>
  
  <p>I am using Java to generate this date but everything I've tried so far yeilds the following error:</p>
  
  <pre><code>java.sql.SQLException: ORA-01843: not a valid month
  </code></pre>
  
  <p>Can anyone suggest java code to generate a proper date?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The dates in the DB look like <code>11-DEC-06</code></p>
  
  <p>SO, I've tried the following:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  SimpleDateFormat sdf = new SimpleDateFormat("d-MMM-yy");
  String date = sdf.format(cal.getTime());
  </code></pre>
  
  <p>And this doesn't work</p>