mark reusen wrote:The fault I receive by updating the Date in the database is like below:
exception java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
and that is because of the unexpected format after parse.......
No, that means the parsing from String to java.util.Date went successfully, but when you insert this in the database, for example using a PreparedStatement, it expects a
java.
sql.Date object and not a java.
util.Date object. (Unfortunately the date and time APIs in Java's standard library are not great, so this is one of those problems you get...).
You have to create a java.sql.Date object out of your java.util.Date object to be able to use it to insert it into the database.