title: Convert String to SQL Date
body: <p>I have a <code>String</code> which contains date string eg 12-28-18 of format MM-dd-yy. I wish to pass this parameter to a stored procedure in Oracle database.</p>
  
  <p>Hence, I am trying to convert this String to <code>java.sql.Date</code>. Following is the method I am following to convert: </p>
  
  <pre><code>DateFormat df = new SimpleDateFormat("MM-dd-yy");
  java.util.Date date1 = df.parse(valueobject.getDate());
  java.sql.Date date2 = new java.sql.Date(date1.getTime())
  </code></pre>
  
  <p>However , it leads to <code>ParseException</code>.
  Not able to figure out why it fails during parsing.
  Any help on this would be great!</p>