title: How do I format a java.sql.date into this format: "MM-dd-yyyy"?
body: <p>I need to get a java.sql.date in the following format "MM-dd-yyyy", but I need it to stay a java.sql.date so I can put it into a table as date field.  So, it cannot be a String after the formatting, it has to end up as a java.sql.date object. </p>
  
  <p>This is what I have tried so far:</p>
  
  <pre><code>java.util.Date 
  today=new Date();
  String date = formatter.format(today); 
  Date todaydate = formatter.parse(date);
  java.sql.Date fromdate = new java.sql.Date(todaydate.getTime());
  java.sql.Date todate=new java.sql.Date(todaydate.getTime()); 
  String tempfromdate=formatter.format(fromdate);
  String temptodate=formatter.format(todate); 
  java.sql.Date fromdate1=(java.sql.Date) formatter.parse(tempfromdate); 
  java.sql.Date todate1=(java.sql.Date) formatter.parse(temptodate);
  </code></pre>