I was getting the following error using Oracle 9.2.0.5 with SQLUnit 4.1.
At ${result[1,1,5]}, could not convert java.sql.Timestamp returned from database to DATE(91)
Oracle returns dates as java.sql.Timestamp objects. By adding the following lines to the Oralce section of types.properties I have SQLUnit working properly.
Although my solution works, it is not the documented way to add type mappings. I should of added the above properties to usertypes.properties and included usertypes.properties in my classpath. However, I would like this to be included in the main distribution since it is such a common type.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, I will update this information in the types.properties so the next release will have this out of the box.
Yes, its not the documented way to add mappings, but the usertypes.properties approach is for people who would rather not touch any of the source code, and who dont want to wait for the next release to get their code working. But I do expect that they will report back these findings so it can be folded in to the types.properties and SQLUnit supports more types correctly across different databases over time, and life becomes easier for people down the line.
Thank you for the feedback, it should be in CVS shortly.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was getting the following error using Oracle 9.2.0.5 with SQLUnit 4.1.
At ${result[1,1,5]}, could not convert java.sql.Timestamp returned from database to DATE(91)
Oracle returns dates as java.sql.Timestamp objects. By adding the following lines to the Oralce section of types.properties I have SQLUnit working properly.
oracle.DATE.class = net.sourceforge.sqlunit.types.TimestampType
oracle.DATE.type = 91
Although my solution works, it is not the documented way to add type mappings. I should of added the above properties to usertypes.properties and included usertypes.properties in my classpath. However, I would like this to be included in the main distribution since it is such a common type.
Hi Brian,
Thank you, I will update this information in the types.properties so the next release will have this out of the box.
Yes, its not the documented way to add mappings, but the usertypes.properties approach is for people who would rather not touch any of the source code, and who dont want to wait for the next release to get their code working. But I do expect that they will report back these findings so it can be folded in to the types.properties and SQLUnit supports more types correctly across different databases over time, and life becomes easier for people down the line.
Thank you for the feedback, it should be in CVS shortly.
-sujit