Content

If you try to do like:

Calendar cal = Calendar.getInstance();
java.util.Date uDate = cal.getTime();
java.sql.Date sDate = (java.sql.Date) uDate;

You will obtain a cast exception. Instead, you can do like:

Calendar cal = Calendar.getInstance();
java.util.Date uDate = cal.getTime();
java.sql.Date sDate = new java.sql.Date(uDate.getTime());

References