public class DatabaseMetadataHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
DatabaseMetadataHelper.ColumnsIteratorCallback
The Interface ColumnsIteratorCallback.
|
static interface |
DatabaseMetadataHelper.Filter<T>
The Interface Filter.
|
static interface |
DatabaseMetadataHelper.IndicesIteratorCallback
The Interface IndicesIteratorCallback.
|
| Constructor and Description |
|---|
DatabaseMetadataHelper() |
| Modifier and Type | Method and Description |
|---|---|
static TableMetadata |
describeTable(Connection connection,
String catalogName,
String schemeName,
String tableName)
List tables.
|
static String |
getMetadataAsJson(DataSource dataSource)
Gets the metadata as json.
|
static String |
getProductName(DataSource dataSource)
Gets the product name
|
static String |
getTableMetadataAsJson(DataSource dataSource,
String schema,
String table)
Gets the metadata as json.
|
static void |
iterateTableDefinition(Connection connection,
String catalogName,
String schemaName,
String tableName,
DatabaseMetadataHelper.ColumnsIteratorCallback columnsIteratorCallback,
DatabaseMetadataHelper.IndicesIteratorCallback indicesIteratorCallback)
Iterate table definition.
|
static List<SchemaMetadata> |
listSchemas(Connection connection,
String catalogName,
DatabaseMetadataHelper.Filter<String> schemaNameFilter,
DatabaseMetadataHelper.Filter<String> tableNameFilter)
List schemas.
|
static List<TableMetadata> |
listTables(Connection connection,
String catalogName,
String schemeName,
DatabaseMetadataHelper.Filter<String> tableNameFilter)
List tables.
|
public static List<SchemaMetadata> listSchemas(Connection connection, String catalogName, DatabaseMetadataHelper.Filter<String> schemaNameFilter, DatabaseMetadataHelper.Filter<String> tableNameFilter) throws SQLException
connection - the connectioncatalogName - the catalog nameschemaNameFilter - the schema name filtertableNameFilter - the table name filterSQLException - the SQL exceptionpublic static List<TableMetadata> listTables(Connection connection, String catalogName, String schemeName, DatabaseMetadataHelper.Filter<String> tableNameFilter) throws SQLException
connection - the connectioncatalogName - the catalog nameschemeName - the scheme nametableNameFilter - the table name filterSQLException - the SQL exceptionpublic static TableMetadata describeTable(Connection connection, String catalogName, String schemeName, String tableName) throws SQLException
connection - the connectioncatalogName - the catalog nameschemeName - the scheme nametableName - the table nameSQLException - the SQL exceptionpublic static void iterateTableDefinition(Connection connection, String catalogName, String schemaName, String tableName, DatabaseMetadataHelper.ColumnsIteratorCallback columnsIteratorCallback, DatabaseMetadataHelper.IndicesIteratorCallback indicesIteratorCallback) throws SQLException
connection - the connectioncatalogName - the catalog nameschemaName - the schema nametableName - the table namecolumnsIteratorCallback - the columns iterator callbackindicesIteratorCallback - the indices iterator callbackSQLException - the SQL exceptionpublic static String getMetadataAsJson(DataSource dataSource) throws SQLException
dataSource - the data sourceSQLException - the SQL exceptionpublic static String getTableMetadataAsJson(DataSource dataSource, String schema, String table) throws SQLException
dataSource - the data sourceschema - the schema nametable - the table nameSQLException - the SQL exceptionpublic static String getProductName(DataSource dataSource) throws SQLException
dataSource - the data sourceSQLException - the SQL exceptionCopyright © 2010–2018 Eclipse Foundation. All rights reserved.