code: public static java.sql.Date convertDate(String date, Locale locale) {
          SimpleDateFormat df;
          java.util.Date dbDate = null;
          java.sql.Date sqldate = null;
          try {
              if (date == null || date.equals("")) {
                  return null;
              }
  
              df = (SimpleDateFormat) DateFormat.getDateInstance(dateStyle, locale);
  
              SimpleDateFormat sdf = new SimpleDateFormat(df.toPattern());
              java.text.ParsePosition pos = new java.text.ParsePosition(0);
              sdf.setLenient(false);
              dbDate = sdf.parse(date, pos);
              return new java.sql.Date(dbDate.getTime());
  
          } catch (Exception e) {
              return null;
          }
      }
docs: Converts the users input date value to java.sql.Date
  
  @param date Date to convert
  @return The converted date in java.sql.date format