Top Description Fields Constructors Methods
org.h2.bnf.context

public Class DbContents

extends Object
Class Inheritance
Imports
java.sql.Connection, .DatabaseMetaData, .ResultSet, .SQLException, java.util.ArrayList, org.h2.engine.Session, org.h2.jdbc.JdbcConnection, org.h2.util.ParserUtil, .StringUtils, .Utils

Keeps meta data information about a database. This class is used by the H2 Console.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private DbSchema
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private DbSchema[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DbSchema

Returns:

the default schema.
getDefaultSchema
()

private String
private String[]
public DbSchema[]

Returns:

the list of schemas.
getSchemas
()

public boolean

Returns:

true if this is an IBM DB2 database.
isDB2
()

public boolean

Returns:

true if this is an Apache Derby database.
isDerby
()

public boolean

Returns:

true if this is a Firebird database.
isFirebird
()

public boolean

Returns:

true if this is a H2 database.
isH2
()

public boolean

Returns:

true if this is a MS SQL Server database.
isMSSQLServer
()

public boolean

Returns:

true if this is a MySQL database.
isMySQL
()

public boolean

Returns:

true if this is an Oracle database.
isOracle
()

public boolean

Returns:

true if this is a PostgreSQL database.
isPostgreSQL
()

public boolean

Returns:

true if this is an SQLite database.
isSQLite
()

public boolean

Returns:

whether standard INFORMATION_SCHEMA.VIEWS may be supported
mayHaveStandardViews
()

Returns whether standard INFORMATION_SCHEMA.VIEWS may be supported.

public String

Returns:

the quoted identifier
quoteIdentifier
(String
the identifier
identifier
)

Add double quotes around an identifier if required.

public synchronized void
readContents(String
the database URL
url
,
Connection
the connection
conn
)

Read the contents of this database from the database meta data.

public void
setMayHaveStandardViews(boolean
whether standard INFORMATION_SCHEMA.VIEWS is detected as supported
mayHaveStandardViews
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseToLowerback to summary
private boolean databaseToLower
databaseToUpperback to summary
private boolean databaseToUpper
defaultSchemaback to summary
private DbSchema defaultSchema
isDB2back to summary
private boolean isDB2
isDerbyback to summary
private boolean isDerby
isFirebirdback to summary
private boolean isFirebird
isH2back to summary
private boolean isH2
isMSSQLServerback to summary
private boolean isMSSQLServer
isMySQLback to summary
private boolean isMySQL
isOracleback to summary
private boolean isOracle
isPostgreSQLback to summary
private boolean isPostgreSQL
isSQLiteback to summary
private boolean isSQLite
mayHaveStandardViewsback to summary
private boolean mayHaveStandardViews
schemasback to summary
private DbSchema[] schemas

Constructor Detail

DbContentsback to summary
public DbContents()

Method Detail

getDefaultSchemaback to summary
public DbSchema getDefaultSchema()
Returns:DbSchema

the default schema.

getDefaultSchemaNameback to summary
private String getDefaultSchemaName(DatabaseMetaData meta)
getSchemaNamesback to summary
private String[] getSchemaNames(DatabaseMetaData meta) throws SQLException
getSchemasback to summary
public DbSchema[] getSchemas()
Returns:DbSchema[]

the list of schemas.

isDB2back to summary
public boolean isDB2()
Returns:boolean

true if this is an IBM DB2 database.

isDerbyback to summary
public boolean isDerby()
Returns:boolean

true if this is an Apache Derby database.

isFirebirdback to summary
public boolean isFirebird()
Returns:boolean

true if this is a Firebird database.

isH2back to summary
public boolean isH2()
Returns:boolean

true if this is a H2 database.

isMSSQLServerback to summary
public boolean isMSSQLServer()
Returns:boolean

true if this is a MS SQL Server database.

isMySQLback to summary
public boolean isMySQL()
Returns:boolean

true if this is a MySQL database.

isOracleback to summary
public boolean isOracle()
Returns:boolean

true if this is an Oracle database.

isPostgreSQLback to summary
public boolean isPostgreSQL()
Returns:boolean

true if this is a PostgreSQL database.

isSQLiteback to summary
public boolean isSQLite()
Returns:boolean

true if this is an SQLite database.

mayHaveStandardViewsback to summary
public boolean mayHaveStandardViews()

Returns whether standard INFORMATION_SCHEMA.VIEWS may be supported.

Returns:boolean

whether standard INFORMATION_SCHEMA.VIEWS may be supported

quoteIdentifierback to summary
public String quoteIdentifier(String identifier)

Add double quotes around an identifier if required.

Parameters
identifier:String

the identifier

Returns:String

the quoted identifier

readContentsback to summary
public synchronized void readContents(String url, Connection conn) throws SQLException

Read the contents of this database from the database meta data.

Parameters
url:String

the database URL

conn:Connection

the connection

Exceptions
SQLException:
on failure
setMayHaveStandardViewsback to summary
public void setMayHaveStandardViews(boolean mayHaveStandardViews)
Parameters
mayHaveStandardViews:boolean

whether standard INFORMATION_SCHEMA.VIEWS is detected as supported