SchemaProvider
public class DefaultSchemaProvider extends Object implements SchemaProvider
Constructor | Description |
---|---|
DefaultSchemaProvider(Connection conn) |
Modifier and Type | Method | Description |
---|---|---|
List<QualifiedName> |
findTables(String dbName,
String tableNamePattern) |
Find all tables matching the specified pattern.
|
List<QualifiedName> |
findTables(String dbName,
String tableNamePattern,
boolean all) |
|
String |
getDbName(String dbName,
String tableName) |
Find the database containing this table.
|
List<String> |
getDbNames(String dbName) |
PRAGMA database_list
|
String |
getSchema(String dbName,
String tableName) |
public DefaultSchemaProvider(Connection conn)
public List<QualifiedName> findTables(String dbName, String tableNamePattern) throws SQLException
SchemaProvider
findTables
in interface SchemaProvider
dbName
- May be null to search in all databases, empty to search in "temp"
and "main"
.tableNamePattern
- LIKE pattern. May be null to retrieve all tables.SQLException
public List<QualifiedName> findTables(String dbName, String tableNamePattern, boolean all) throws SQLException
SQLException
public String getDbName(String dbName, String tableName) throws SQLException
SchemaProvider
getDbName
in interface SchemaProvider
dbName
- May be null to search in all databases, empty to search in "temp"
and "main"
.tableName
- Table name"temp"
or "main"
or attached database name.
If there is no table matching tableName
, the returned value is undefined.SQLException
public List<String> getDbNames(String dbName) throws SQLException
SchemaProvider
getDbNames
in interface SchemaProvider
dbName
- May be null to search in all databases, empty to search in "temp"
and "main"
.SQLException
public String getSchema(String dbName, String tableName) throws SQLException
getSchema
in interface SchemaProvider
dbName
- null
means "main"
.tableName
- Table nameSQLException
Copyright © 2018. All rights reserved.