Java: Error while saving date value to database(Simpledataformat)
<p>I am trying to save a date in DB but i am getting the below error. I am confused because i am sending the same format but still throwing exception:</p>

<blockquote>
  <p>java.lang.IllegalArgumentException: Timestamp format must be
  yyyy-mm-dd hh:mm:ss[.fffffffff]</p>
</blockquote>

<p>If i am trying in <strong>SQL Developer</strong> in the below way it works fine</p>

<pre><code>to_date('01/01/1900', 'mm/dd/yyyy')
</code></pre>

<p>Through java i tried doing as below</p>

<p>First Method </p>

<pre><code>SimpleDateFormat format1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date myDate = format1.parse("01/01/1900 00:00:00");
</code></pre>

<p>Second Method</p>

<pre><code>SimpleDateFormat format1 = new SimpleDateFormat("dd/MM/yyyy");
Date myDate = format1.parse("01/01/1900");
</code></pre>

<p>Where am i going wrong.</p>

<p><strong>P.S : Please before marking it as duplicate and stopping people from answering question understand i have tried something and got the error.</strong></p>