title: Error in getting Date input form user and storing in database using JSF
body: <p>I am developing a web application based on JSF technology. I use Eclipse as the IDE and using Apache Derby as a database.</p>
  
  <p>When getting user input, I have one of the fields as a date field, i.e, Date of Birth.
  But when I update the database table, I get error report.</p>
  
  <pre><code> Date Of Birth:
   &lt;h:inputText value="#{employeeBean.dob}"&gt;
   &lt;f:convertDateTime type="date" pattern="yyyy-mm-dd"/&gt;
   &lt;/h:inputText&gt;
  </code></pre>
  
  <p>Since the derby database accepts date in the format yyyy-mm-dd, I give input in the same way and have also used the same format.</p>
  
  <p>This is the error I get.</p>
  
  <pre><code> Exception while setting value for expression : #{employeeBean.dob} of component with 
   path : {Component-Path : [Class:javax.faces.component.UIViewRoot,ViewId: /homepage.jsp]
   [Class: javax.faces.component.html.HtmlForm,Id: j_id_jsp_996426310_1]
   [Class: javax.faces.component.html.HtmlInputText,Id: j_id_jsp_996426310_6]}
  
   Caused by:
   java.lang.IllegalArgumentException - Cannot convert 1/8/87 5:39 AM of type class
   java.util.Date to class java.sql.Date
  </code></pre>
  
  <p>Some one help me with this.</p>