0

I have a code on sql prepared statement and I am trying to convert util.date format to sql.date format but not head way

//this is a handle of prepatedstatement
ps.setDate(6, rec.getDate());

I am converting the date from a string to a date class in a DAO class as shown

String s = hr_recdate.getText();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            java.util.Date date = sdf.parse(s);
rec.setDate(date);

Please how do I convert rec.getDate() of java.util to sql.util

Francis
  • 201
  • 3
  • 7
  • 20

0 Answers0