I'm designing a test framework using dbunit. I collect expected data from a database (using a QueryDataSet which I funnel into a DefaultDataSet by applying getTables to the QueryDataSet). Similarly, I collect the actual data set from a different database. This actual data represents the result of a data integration that I run before checking for the actual data. I use the same approach, but different Java method for obtaining this two sets of data.
When comparing the two data sets, I get a lot of differences resulting from dates and timestamps. There are two basic types of mismatches. For example:
1) Timestamp '01-JAN-00 12.00.00.000000000' interpreted as the year 2000 in one data set and as the year 3000 in the other data set.
2) Date '01-JAN-08' is interpreted differently in the two data sets as well. It adds a time in the comparison. In one it says '12:00:00.0' (I guess noon) and in the other one it says '00:00:00.0' (I guess midnight).
When I look at the two DBs the contents seems to be exactly the same. So I naturally thought, it has something to do with the nls session parameters of the connections I use to obtain the data. I did a comparison and they look absolutely the same. The schemas report the same nls paramaters, and the DB is actually the same, so it must have the same nls parameters. I also tried setting the session parameters explicitly to NLS_DATE_LANGUAGE='ENGLISH'; to no avail.
Can anybody help? I'm a little lost. I can provide more detail about how I build the data sets if needed. Any help is greatly appreciated.
PS I use an Oracle DB 12c.
Dr. Yves Brise Senior Consultant
Innovation Process Technology AG Poststrasse 14, CH-6300 Zug M +41 79 792 62 18, T +41 41 727 25 25 [hidden email], www.ipt.ch