Package org.dbunit.ext.db2
Class Db2MetadataHandler
java.lang.Object
org.dbunit.database.DefaultMetadataHandler
org.dbunit.ext.db2.Db2MetadataHandler
- All Implemented Interfaces:
IMetadataHandler
Customized MetadataHandler for DB2 as match Columns of
DefaultMetadataHandler
fails with a RuntimeException.- Since:
- 2.4.7
- Version:
- $Revision$ $Date$
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(ResultSet columnsResultSet, String catalog, String schema, String table, String column, boolean caseSensitive) This method is overridden since - at least with DB2 driver db2jcc-9.5.jar - there is a problem that theDatabaseMetaDatadoes not return the same values for catalog and schema like the columnsResultSetdoes.Methods inherited from class org.dbunit.database.DefaultMetadataHandler
getColumns, getPrimaryKeys, getSchema, getTables, matches, tableExists
-
Constructor Details
-
Db2MetadataHandler
public Db2MetadataHandler()
-
-
Method Details
-
matches
public boolean matches(ResultSet columnsResultSet, String catalog, String schema, String table, String column, boolean caseSensitive) throws SQLException This method is overridden since - at least with DB2 driver db2jcc-9.5.jar - there is a problem that theDatabaseMetaDatadoes not return the same values for catalog and schema like the columnsResultSetdoes. The debugging constellation is as followscatalog="BLA", catalogName=
This problem is taken into account by this metadata handler. Checks if the givenschema="BLA", schemaName="BLA" resultSetmatches the given schema and table name. The comparison is case sensitive.- Specified by:
matchesin interfaceIMetadataHandler- Overrides:
matchesin classDefaultMetadataHandler- Parameters:
columnsResultSet- A result set produced viaDatabaseMetaData.getColumns(String, String, String, String)catalog- The name of the catalog to check. Ifnullit is ignored in the comparisonschema- The name of the schema to check. Ifnullit is ignored in the comparisontable- The name of the table to check. Ifnullit is ignored in the comparisoncolumn- The name of the column to check. Ifnullit is ignored in the comparisoncaseSensitive- Whether or not the comparison should be case sensitive- Returns:
trueif the column metadata of the givenresultSetmatches the given schema and table parameters.- Throws:
SQLException- See Also:
-