{
try
{
Object tsc = timestampClass.cast(databaseFieldValue);
Method dateValueMethod = timestampClass.getMethod("dateValue");
Date dateValue = (Date) dateValueMethod.invoke(tsc);
long time = dateValue.getTime();
assertEquals(f.name(),time,((Long)avroField).longValue());
}
catch(Exception ex)
{
String errMsg = "SQLException reading oracle.sql.TIMESTAMP value for field " + f.name();
LOG.error(errMsg);
throw new RuntimeException(errMsg, ex);
}
}
else if (dateClass.isInstance(databaseFieldValue))
{
try
{
Object dsc = dateClass.cast(databaseFieldValue);
Method dateValueMethod = dateClass.getMethod("dateValue");
Date dateValue = (Date) dateValueMethod.invoke(dsc);
long time = dateValue.getTime();
assertEquals(f.name(),time,((Long)avroField).longValue());
}
catch (Exception ex)
{
String errMsg = "SQLException reading oracle.sql.DATE value for field " + f.name();