org.dbunit.database
Interface IMetadataHandler

All Known Implementing Classes:
DefaultMetadataHandler, MySqlMetadataHandler

public interface IMetadataHandler

Handler to specify the behavior for a lookup of column metadata using database metadata.

Since:
2.4.4
Version:
$Revision: 962 $ $Date: 2009-02-14 20:46:32 +0100 (Sat, 14 Feb 2009) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Method Summary
 java.sql.ResultSet getColumns(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String tableName)
          Returns the result set for an invocation of DatabaseMetaData.getColumns(String, String, String, String).
 java.lang.String getSchema(java.sql.ResultSet resultSet)
          Returns the schema name to which the table of the current result set index belongs.
 boolean matches(java.sql.ResultSet resultSet, java.lang.String schema, java.lang.String table, boolean caseSensitive)
          Checks if the given resultSet matches the given schema and table name.
 boolean matches(java.sql.ResultSet resultSet, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column, boolean caseSensitive)
          Checks if the given resultSet matches the given schema and table name.
 

Method Detail

getColumns

java.sql.ResultSet getColumns(java.sql.DatabaseMetaData databaseMetaData,
                              java.lang.String schemaName,
                              java.lang.String tableName)
                              throws java.sql.SQLException
Returns the result set for an invocation of DatabaseMetaData.getColumns(String, String, String, String).

Parameters:
databaseMetaData - The database metadata to be used for retrieving the columns
schemaName - The schema name
tableName - The table name
Returns:
The result set containing all columns
Throws:
java.sql.SQLException
Since:
2.4.4

matches

boolean matches(java.sql.ResultSet resultSet,
                java.lang.String schema,
                java.lang.String table,
                boolean caseSensitive)
                throws java.sql.SQLException
Checks if the given resultSet matches the given schema and table name. The comparison is case sensitive.

Parameters:
resultSet - A result set produced via DatabaseMetaData.getColumns(String, String, String, String)
schema -
table -
caseSensitive - Whether or not the comparison should be case sensitive
Returns:
true if the column metadata of the given resultSet matches the given schema and table parameters.
Throws:
java.sql.SQLException
Since:
2.4.4
See Also:
matches(ResultSet, String, String, String, String, boolean)

matches

boolean matches(java.sql.ResultSet resultSet,
                java.lang.String catalog,
                java.lang.String schema,
                java.lang.String table,
                java.lang.String column,
                boolean caseSensitive)
                throws java.sql.SQLException
Checks if the given resultSet matches the given schema and table name. The comparison is case sensitive.

Parameters:
resultSet - A result set produced via DatabaseMetaData.getColumns(String, String, String, String)
catalog - The name of the catalog to check. If null it is ignored in the comparison
schema - The name of the schema to check. If null it is ignored in the comparison
table - The name of the table to check. If null it is ignored in the comparison
column - The name of the column to check. If null it is ignored in the comparison
caseSensitive - Whether or not the comparison should be case sensitive
Returns:
true if the column metadata of the given resultSet matches the given schema and table parameters.
Throws:
java.sql.SQLException
Since:
2.4.4

getSchema

java.lang.String getSchema(java.sql.ResultSet resultSet)
                           throws java.sql.SQLException
Returns the schema name to which the table of the current result set index belongs.

Parameters:
resultSet - The result set pointing to a valid record in the database that was returned by DatabaseMetaData.getTables(String, String, String, String[]).
Returns:
The name of the schema from the given result set
Throws:
java.sql.SQLException
Since:
2.4.4


Copyright © 2002-2009. All Rights Reserved.