Package org.dbunit.ext.netezza
Class NetezzaMetadataHandler
java.lang.Object
org.dbunit.ext.netezza.NetezzaMetadataHandler
- All Implemented Interfaces:
IMetadataHandler
Special metadata handler for Netezza.
- Since:
- 2.4.6
- Version:
- $Revision$ $Date$
- Author:
- Ameet (amit3011 AT users.sourceforge.net), Last changed by: $Author$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColumns(DatabaseMetaData databaseMetaData, String schemaName, String tableName) Returns the result set for an invocation ofDatabaseMetaData.getColumns(String, String, String, String).getPrimaryKeys(DatabaseMetaData metaData, String schemaName, String tableName) Returns the primary keys of the given table.Returns the schema name to which the table of the current result set index belongs.getTables(DatabaseMetaData metaData, String schemaName, String[] tableType) Returns the tables in the given schema that matches one of the given tableTypes.booleanChecks if the givenresultSetmatches the given schema and table name.booleanmatches(ResultSet columnsResultSet, String catalog, String schema, String table, String column, boolean caseSensitive) Checks if the givenresultSetmatches the given schema and table name.booleantableExists(DatabaseMetaData metaData, String schema, String tableName) Checks if the given table exists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dbunit.database.IMetadataHandler
matchesColumn, supportsColumnCache
-
Constructor Details
-
NetezzaMetadataHandler
public NetezzaMetadataHandler()Default constructor.
-
-
Method Details
-
getColumns
public ResultSet getColumns(DatabaseMetaData databaseMetaData, String schemaName, String tableName) throws SQLException Description copied from interface:IMetadataHandlerReturns the result set for an invocation ofDatabaseMetaData.getColumns(String, String, String, String).- Specified by:
getColumnsin interfaceIMetadataHandler- Parameters:
databaseMetaData- The database metadata to be used for retrieving the columnsschemaName- The schema nametableName- The table name- Returns:
- The result set containing all columns
- Throws:
SQLException- if a database access error occurs.
-
matches
public boolean matches(ResultSet resultSet, String schema, String table, boolean caseSensitive) throws SQLException Description copied from interface:IMetadataHandlerChecks if the givenresultSetmatches the given schema and table name. The comparison is case sensitive.- Specified by:
matchesin interfaceIMetadataHandler- Parameters:
resultSet- A result set produced viaDatabaseMetaData.getColumns(String, String, String, String)schema- the schema name to check.table- the table name to check.caseSensitive- 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- if a database access error occurs.- See Also:
-
matches
public boolean matches(ResultSet columnsResultSet, String catalog, String schema, String table, String column, boolean caseSensitive) throws SQLException Description copied from interface:IMetadataHandlerChecks if the givenresultSetmatches the given schema and table name. The comparison is case sensitive.- Specified by:
matchesin interfaceIMetadataHandler- 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- if a database access error occurs.
-
getSchema
Description copied from interface:IMetadataHandlerReturns the schema name to which the table of the current result set index belongs.- Specified by:
getSchemain interfaceIMetadataHandler- Parameters:
resultSet- The result set pointing to a valid record in the database that was returned byDatabaseMetaData.getTables(String, String, String, String[]).- Returns:
- The name of the schema from the given result set
- Throws:
SQLException- if a database access error occurs.
-
tableExists
public boolean tableExists(DatabaseMetaData metaData, String schema, String tableName) throws SQLException Description copied from interface:IMetadataHandlerChecks if the given table exists.- Specified by:
tableExistsin interfaceIMetadataHandler- Parameters:
metaData- The database meta dataschema- The schema in which the table should be searched. Ifnullthe schema is not used to narrow the table name.tableName- The table name to be searched- Returns:
- Returns
trueif the given table exists in the given schema. Else returnsfalse. - Throws:
SQLException- if a database access error occurs.
-
getTables
public ResultSet getTables(DatabaseMetaData metaData, String schemaName, String[] tableType) throws SQLException Description copied from interface:IMetadataHandlerReturns the tables in the given schema that matches one of the given tableTypes.- Specified by:
getTablesin interfaceIMetadataHandler- Parameters:
metaData- The database meta dataschemaName- schema for which the tables should be retrieved;nullreturns all schemastableType- a list of table types to include;nullreturns all types- Returns:
- The ResultSet which is retrieved using
DatabaseMetaData.getTables(String, String, String, String[]) - Throws:
SQLException- if a database access error occurs.
-
getPrimaryKeys
public ResultSet getPrimaryKeys(DatabaseMetaData metaData, String schemaName, String tableName) throws SQLException Description copied from interface:IMetadataHandlerReturns the primary keys of the given table.- Specified by:
getPrimaryKeysin interfaceIMetadataHandler- Parameters:
metaData- The database meta dataschemaName- schema for which the tables should be retrieved;nullreturns all schemastableName- table for which the primary keys are retrieved- Returns:
- The ResultSet which is retrieved using
DatabaseMetaData.getPrimaryKeys(String, String, String) - Throws:
SQLException- if a database access error occurs.
-