次のコード スニペットに対して、以下のエラーが発生します。
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.
}
}
エラー:
Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date
データベースでは、列のデータ型はDATE
only です。Timestamp
がここに来る場所を把握できません。