I am getting the below given error for the following code snippets:
try {
cRows = new CachedRowSetImpl();
while(cRows.next())
{
MyClass myClass = new MyClass();
myClass.setPrevDate(cRows.getDate("PREV_DATE")); // In debug mode, the error was throwing when I press Resume from here.
}
}
Error:
Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date
In the database, the datatype for the column is DATE only. I am not able to figure out where the Timestamp is coming here.
http://stackoverflow.com/questions/20130129/error-java-sql-timestamp-cannot-be-cast-to-java-sql-date-in-jfreechartCachedRowSetImplis fromimport com.sun.rowset.CachedRowSetImpl;18-09-14and isDATEin type.