title: error casting Java.Util.Date into Java.Sql.Date
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/530012/how-to-convert-java-util-date-to-java-sql-date">How to convert java.util.date to java.sql.date?</a>  </p>
  </blockquote>
  
  
  
  <p>I found error on my function, it shows error result after initializing the newInstance() method from DatatypeFactory df , I'm getting another error:</p>
  
  <pre><code>java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
  </code></pre>
  
  <p>I just change the package name from</p>
  
  <pre><code>java.util.Date into java.SQL.Date
  </code></pre>
  
  <p>then casting:</p>
  
  <pre><code>Date dateStarting  = (Date) jDateChooserStart.getDate();
  Date dateEnding    = (Date) jDateChooserEnd.getDate();
  </code></pre>
  
  <p>How to resolve this issue?</p>
  
  <p>(post before: <a href="https://stackoverflow.com/questions/12130680/convert-jcalendar-date-into-xmlgregoriancalendar-getting-null-value">Convert jcalendar Date into XMLGregorianCalendar Getting Null Value</a>)</p>