org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <1997-02-14 00:00:00.0> of type <java.lang.String> to TIMESTAMP

Stack Overflow | ArbiPorter | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    DBunit - Unable to typecast <1997/02/14> to TimeStamp

    Stack Overflow | 8 months ago | ArbiPorter
    org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <1997-02-14 00:00:00.0> of type <java.lang.String> to TIMESTAMP

    Root Cause Analysis

    1. org.dbunit.dataset.datatype.TypeCastException

      Unable to typecast value <1997-02-14 00:00:00.0> of type <java.lang.String> to TIMESTAMP

      at test.CustomTimestampDataType.typeCast()
    2. test
      CustomTimestampDataType.setSqlValue
      1. test.CustomTimestampDataType.typeCast(CustomTimestampDataType.java:69)
      2. test.CustomTimestampDataType.setSqlValue(CustomTimestampDataType.java:84)
      2 frames
    3. dbUnit Extension
      DatabaseTestCase.setUp
      1. org.dbunit.database.statement.SimplePreparedStatement.addValue(SimplePreparedStatement.java:73)
      2. org.dbunit.operation.RefreshOperation$RowOperation.execute(RefreshOperation.java:189)
      3. org.dbunit.operation.RefreshOperation.execute(RefreshOperation.java:113)
      4. org.dbunit.AbstractDatabaseTester.executeOperation(AbstractDatabaseTester.java:190)
      5. org.dbunit.AbstractDatabaseTester.onSetup(AbstractDatabaseTester.java:103)
      6. org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:156)
      6 frames
    4. test
      PlayerTest.setUp
      1. test.HibernateDbUnitTestCase.setUp(HibernateDbUnitTestCase.java:85)
      2. test.PlayerTest.setUp(PlayerTest.java:117)
      2 frames