public interface IMetadataHandler
Modifier and Type | Method and Description |
---|---|
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.sql.ResultSet |
getPrimaryKeys(java.sql.DatabaseMetaData databaseMetaData,
java.lang.String schemaName,
java.lang.String tableName) |
java.lang.String |
getSchema(java.sql.ResultSet resultSet)
Returns the schema name to which the table of the current result set index belongs.
|
java.sql.ResultSet |
getTables(java.sql.DatabaseMetaData databaseMetaData,
java.lang.String schemaName,
java.lang.String[] tableTypes)
Returns the tables in the given schema that matches one of the given tableTypes.
|
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. |
boolean |
tableExists(java.sql.DatabaseMetaData databaseMetaData,
java.lang.String schemaName,
java.lang.String tableName)
Checks if the given table exists.
|
java.sql.ResultSet getColumns(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
DatabaseMetaData.getColumns(String, String, String, String)
.databaseMetaData
- The database metadata to be used for retrieving the columnsschemaName
- The schema nametableName
- The table namejava.sql.SQLException
boolean matches(java.sql.ResultSet resultSet, java.lang.String schema, java.lang.String table, boolean caseSensitive) throws java.sql.SQLException
resultSet
matches the given schema and table name.
The comparison is case sensitive.resultSet
- A result set produced via DatabaseMetaData.getColumns(String, String, String, String)
schema
- table
- caseSensitive
- Whether or not the comparison should be case sensitivetrue
if the column metadata of the given resultSet
matches
the given schema and table parameters.java.sql.SQLException
matches(ResultSet, String, String, String, String, boolean)
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
resultSet
matches the given schema and table name.
The comparison is case sensitive.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 comparisonschema
- The name of the schema to check. If null
it is ignored in the comparisontable
- The name of the table to check. If null
it is ignored in the comparisoncolumn
- The name of the column to check. If null
it is ignored in the comparisoncaseSensitive
- Whether or not the comparison should be case sensitivetrue
if the column metadata of the given resultSet
matches
the given schema and table parameters.java.sql.SQLException
java.lang.String getSchema(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- The result set pointing to a valid record in the database that was returned
by DatabaseMetaData.getTables(String, String, String, String[])
.java.sql.SQLException
boolean tableExists(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
databaseMetaData
- The database meta dataschemaName
- 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 searchedtrue
if the given table exists in the given schema.
Else returns false
.java.sql.SQLException
java.sql.ResultSet getTables(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String[] tableTypes) throws java.sql.SQLException
databaseMetaData
- The database meta dataschemaName
- schema for which the tables should be retrieved; null
returns all schemastableTypes
- a list of table types to include; null
returns all typesDatabaseMetaData.getTables(String, String, String, String[])
java.sql.SQLException
java.sql.ResultSet getPrimaryKeys(java.sql.DatabaseMetaData databaseMetaData, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
databaseMetaData
- The database meta dataschemaName
- schema for which the tables should be retrieved; null
returns all schemastableName
- table for which the primary keys are retrievedDatabaseMetaData.getPrimaryKeys(String, String, String)
java.sql.SQLException
Copyright © 2002-2021. All Rights Reserved.