title: While converting String to Date got ambiguity between java.util.Date and java.sql.Date
body: <p>I am trying to get date as input from Date tag of HTML</p>
  
  <p><code>Birth Date &lt;input type="date"  name="dob"/&gt;</code></p>
  
  <p>and accessing on jsp page by using</p>
  
  <pre><code>String strDate = request.getParameter("dob");
  </code></pre>
  
  <p>but it returns in the format of string and I wanted to convert it in to date, I have tried as follows</p>
  
  <pre><code>SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
  Date date = sdf.parse(strDate);
  </code></pre>
  
  <p>But it gives error </p>
  
  <blockquote>
    <p>incompatible types required: java.sql.Date found:    java.util.Date</p>
  </blockquote>
  
  <p>and when I imported pakage "java.util.*"   for using   <code>java.util.Date date = sdf.parse(strDate);</code> it gives </p>
  
  <blockquote>
    <p>reference to Date is ambiguous, both class java.util.Date in java.util and class java.sql.Date in java.sql match</p>
  </blockquote>