Package org.h2.bnf.context
Class DbSchema
- java.lang.Object
-
- org.h2.bnf.context.DbSchema
-
public class DbSchema extends java.lang.ObjectContains meta data information about a database schema. This class is used by the H2 Console.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCOLUMNS_QUERY_H2_197private static java.lang.StringCOLUMNS_QUERY_H2_202private DbContentscontentsThe database content container.booleanisDefaultTrue if this is the default schema for this database.booleanisSystemTrue if this is a system schema (for example the INFORMATION_SCHEMA).java.lang.StringnameThe schema name.private DbProcedure[]proceduresThe procedures list.java.lang.StringquotedNameThe quoted schema name.private DbTableOrView[]tablesThe table list.
-
Constructor Summary
Constructors Constructor Description DbSchema(DbContents contents, java.lang.String name, boolean isDefault)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DbContentsgetContents()DbProcedure[]getProcedures()DbTableOrView[]getTables()private static java.sql.PreparedStatementprepareColumnsQueryH2(java.sql.Connection connection)voidreadProcedures(java.sql.DatabaseMetaData meta)Read all procedures in the database.voidreadTables(java.sql.DatabaseMetaData meta, java.lang.String[] tableTypes)Read all tables for this schema from the database meta data.
-
-
-
Field Detail
-
COLUMNS_QUERY_H2_197
private static final java.lang.String COLUMNS_QUERY_H2_197
- See Also:
- Constant Field Values
-
COLUMNS_QUERY_H2_202
private static final java.lang.String COLUMNS_QUERY_H2_202
- See Also:
- Constant Field Values
-
name
public final java.lang.String name
The schema name.
-
isDefault
public final boolean isDefault
True if this is the default schema for this database.
-
isSystem
public final boolean isSystem
True if this is a system schema (for example the INFORMATION_SCHEMA).
-
quotedName
public final java.lang.String quotedName
The quoted schema name.
-
contents
private final DbContents contents
The database content container.
-
tables
private DbTableOrView[] tables
The table list.
-
procedures
private DbProcedure[] procedures
The procedures list.
-
-
Constructor Detail
-
DbSchema
DbSchema(DbContents contents, java.lang.String name, boolean isDefault)
-
-
Method Detail
-
getContents
public DbContents getContents()
- Returns:
- The database content container.
-
getTables
public DbTableOrView[] getTables()
- Returns:
- The table list.
-
getProcedures
public DbProcedure[] getProcedures()
- Returns:
- The procedure list.
-
readTables
public void readTables(java.sql.DatabaseMetaData meta, java.lang.String[] tableTypes) throws java.sql.SQLExceptionRead all tables for this schema from the database meta data.- Parameters:
meta- the database meta datatableTypes- the table types to read- Throws:
java.sql.SQLException- on failure
-
prepareColumnsQueryH2
private static java.sql.PreparedStatement prepareColumnsQueryH2(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readProcedures
public void readProcedures(java.sql.DatabaseMetaData meta) throws java.sql.SQLExceptionRead all procedures in the database.- Parameters:
meta- the database meta data- Throws:
java.sql.SQLException- Error while fetching procedures
-
-