Interface IMetadataHandler

All Known Implementing Classes:
Db2MetadataHandler, DefaultMetadataHandler, MySqlMetadataHandler, NetezzaMetadataHandler

public interface IMetadataHandler
Handler to specify the behavior for a lookup of column metadata using database metadata.
Since:
2.4.4
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Method Details

    • getColumns

      ResultSet getColumns(DatabaseMetaData databaseMetaData, String schemaName, String tableName) throws 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:
      SQLException
      Since:
      2.4.4
    • matches

      boolean matches(ResultSet resultSet, String schema, String table, boolean caseSensitive) throws 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:
      SQLException
      Since:
      2.4.4
      See Also:
    • matches

      boolean matches(ResultSet resultSet, String catalog, String schema, String table, String column, boolean caseSensitive) throws 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:
      SQLException
      Since:
      2.4.4
    • getSchema

      String getSchema(ResultSet resultSet) throws 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:
      SQLException
      Since:
      2.4.4
    • tableExists

      boolean tableExists(DatabaseMetaData databaseMetaData, String schemaName, String tableName) throws SQLException
      Checks if the given table exists.
      Parameters:
      databaseMetaData - The database meta data
      schemaName - The schema in which the table should be searched. If null the schema is not used to narrow the table name.
      tableName - The table name to be searched
      Returns:
      Returns true if the given table exists in the given schema. Else returns false.
      Throws:
      SQLException
      Since:
      2.4.5
    • getTables

      ResultSet getTables(DatabaseMetaData databaseMetaData, String schemaName, String[] tableTypes) throws SQLException
      Returns the tables in the given schema that matches one of the given tableTypes.
      Parameters:
      databaseMetaData - The database meta data
      schemaName - schema for which the tables should be retrieved; null returns all schemas
      tableTypes - a list of table types to include; null returns all types
      Returns:
      The ResultSet which is retrieved using DatabaseMetaData.getTables(String, String, String, String[])
      Throws:
      SQLException
      Since:
      2.4.5
    • getPrimaryKeys

      ResultSet getPrimaryKeys(DatabaseMetaData databaseMetaData, String schemaName, String tableName) throws SQLException
      Parameters:
      databaseMetaData - The database meta data
      schemaName - schema for which the tables should be retrieved; null returns all schemas
      tableName - table for which the primary keys are retrieved
      Returns:
      The ResultSet which is retrieved using DatabaseMetaData.getPrimaryKeys(String, String, String)
      Throws:
      SQLException
      Since:
      2.4.5