Problem with DatabaseTableMetaData

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem with DatabaseTableMetaData

Darrell Roberts

I just started using dbunit to test our applications using DB2 V9 FP4. I'm using the type 4 driver for DB2 as well. 

When I use IConnection.createQueryTable(<tablename>, <sql query>) to compare my database data with my data sets I get the following warning message:

"WARN  DatabaseTableMetaData.createColumnFromDbMetaData - Cannot find column from ResultSetMetaData info via DatabaseMetaData. Returning null. Even if this is expected to never happen it probably happened due to a JDBC driver bug. To get around this you may want to configure a user defined interface org.dbunit.database.IMetadataHandler"

I checked-out the source code to dbunit 2.4.8 to further investigate the root cause. The problem seems to be in DefaultMetadataHandler.matches() method. A comparison is performed on the catalog name, schema name, table name and column name read from the DataBaseMetaData and with that of the ResultSetMetaData. The comparison fails on the catalog name. The ResultSetMetaData is able to get the catalog name but the DataBaseMetaData has null for the catalog name.

Has this problem been reported before? Is there a workaround?

Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
dbunit-user mailing list
[hidden email]