title: How to convert Date string to sql date format
body: <p>I want to insert the following into database in sql time date format. </p>
  
  <pre><code>Sat May 02 19:01:30 PDT 2015
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>Calendar calendar = Calendar.getInstance(Locale.US);
  Date formattedDate = calendar.getTime();
  Date = formattedDate.toString();
  javaSqlDate = new java.sql.Date(calendar.getTime().getTime());
  </code></pre>
  
  <p>I am inserting the value like below:</p>
  
  <pre><code>ps.setTimestamp(7, javaSqlDate);
  </code></pre>