I want to save date to oracle from eclipse java program. Right now I am using this code
DateFormat dt=new SimpleDateFormat("MM/dd/yyyy");
java.sql.Date dob=(java.sql.Date)dt.parse("02/02/2015");
ob.setDateOfBirth(dob);
The table has a column named Date_of_birth having date datatype.
But i am getting an error
Exception in thread "main" java.lang.ClassCastException:
java.util.Date cannot be cast to java.sql.Date
at com.TestCustomerDao.main(TestCustomerDao.java:22)
Please Help