| java.lang.Object org.hsqldb.DatabaseInformation org.hsqldb.DatabaseInformationMain
All known Subclasses: org.hsqldb.DatabaseInformationFull,
DatabaseInformationMain | class DatabaseInformationMain extends DatabaseInformation (Code) | | Produces a collection of tables that form the system data dictionary.
Implementations use a group of arrays of equal size to store various
attributes or cached instances of system tables.
Two fixed static lists of reserved table names are kept in String[] and
HsqlName[] forms. These are shared by all implementations of
DatabaseInformtion.
Each implementation keeps a lookup set of names for those tables whose
contents are never cached (nonCachedTablesSet).
An instance of this class uses three lists named sysTablexxxx for caching
system tables.
sysTableSessionDependent indicates which tables contain data that is
dependent on the user rights of the User associatiod with the Session.
sysTableSessions contains the Session with whose rights each cached table
was built.
sysTables contains the cached tables.
At the time of instantiation, which is part of the Database.open() method
invocation, an empty table is created and placed in sysTables with calls to
generateTable(int) for each name in sysTableNames. Some of these
table entries may be null if an implementation does not produce them.
Calls to getSystemTable(String, Session) return a cached table if various
caching rules are met (see below), or it will delete all rows of the table
and rebuild the contents via generateTable(int).
generateTable(int) calls the appropriate single method for each table.
These methods either build and return an empty table (if sysTables
contains null for the table slot) or populate the table with up-to-date
rows.
When the setDirty() call is made externally, the internal isDirty flag
is set. This flag is used next time a call to
getSystemTable(String, Session) is made.
Rules for caching are applied as follows:
When a call to getSystemTable(String, Session) is made, if the isDirty flag
is true, then the contents of all cached tables are cleared and the
sysTableUsers slot for all tables is set to null. This also has the
effect of clearing the isDirty and isDirtyNextIdentity flags
if the isDirtyNextIdentity flag is true at this point, then the contents
of all next identity value dependent cached tables are cleared and the
sysTableUsers slot for these tables are set to null. Currently,
the only member of this set is the SYSTEM_TABLES system table.
If a table has non-cached contents, its contents are cleared and
rebuilt.
For the rest of the tables, if the sysTableSessions slot is null or if the
Session parameter is not the same as the Session object
in that slot, the table contents are cleared and rebuilt.
(fredt@users)
author: boucherb@users version: 1.8.0 since: 1.7.2 |
Method Summary | |
final Table | SYSTEM_ALLTYPEINFO() Retrieves a Table object describing, in an extended
fashion, all of the system or formal specification SQL types known to
this database, including its level of support for them (which may
be no support at all) in various capacities. | final Table | SYSTEM_BESTROWIDENTIFIER() Retrieves a Table object describing the optimal
set of visible columns that uniquely identifies a row
for each accessible table defined within this database. | final Table | SYSTEM_CATALOGS() Retrieves a Table object naming the accessible catalogs
defined within this database. | final Table | SYSTEM_CHECK_CONSTRAINTS() The SYSTEM_CHECK_CONSTRAINTS table has one row for each domain
constraint, table check constraint, and assertion. | final Table | SYSTEM_COLUMNPRIVILEGES() Retrieves a Table object describing the visible
access rights for all visible columns of all accessible
tables defined within this database.
Each row is a column privilege description with the following
columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
COLUMN_NAME VARCHAR column name
GRANTOR VARCHAR grantor of access
GRANTEE VARCHAR grantee of access
PRIVILEGE VARCHAR name of access
IS_GRANTABLE VARCHAR grantable?: "YES" - grant to others, else "NO"
Note: As of 1.7.2, HSQLDB does not support column level
privileges. | final Table | SYSTEM_COLUMNS() | final Table | SYSTEM_CROSSREFERENCE() | final Table | SYSTEM_INDEXINFO() Retrieves a Table object describing the visible
Index objects for each accessible table defined
within this database.
Each row is an index column description with the following
columns:
TABLE_CAT VARCHAR table's catalog
TABLE_SCHEM VARCHAR simple name of table's schema
TABLE_NAME VARCHAR simple name of the table using the index
NON_UNIQUE BOOLEAN can index values be non-unique?
INDEX_QUALIFIER VARCHAR catalog in which the index is defined
INDEX_NAME VARCHAR simple name of the index
TYPE SMALLINT index type: { Clustered | Hashed | Other }
ORDINAL_POSITION SMALLINT column sequence number within index
COLUMN_NAME VARCHAR simple column name
ASC_OR_DESC VARCHAR col. | final Table | SYSTEM_PRIMARYKEYS() Retrieves a Table object describing the visible
primary key columns of each accessible table defined within
this database. | Table | SYSTEM_PROCEDURECOLUMNS() | Table | SYSTEM_PROCEDURES() Retrieves a Table object describing the accessible
routines defined within this database. | final Table | SYSTEM_SCHEMAS() Retrieves a Table object describing the accessible schemas
defined within this database. | final Table | SYSTEM_SEQUENCES() The SYSTEM_SEQUENCES table has one row for each external sequence
generator. | final Table | SYSTEM_TABLEPRIVILEGES() Retrieves a Table object describing the visible access
rights for each accessible table definied within this database. | final Table | SYSTEM_TABLES() Retrieves a Table object describing the accessible
tables defined within this database. | Table | SYSTEM_TABLETYPES() Retrieves a Table object describing the table types
available in this database. | final Table | SYSTEM_TYPEINFO() Retrieves a Table object describing the
result expected by the JDBC DatabaseMetaData interface implementation
for system-defined SQL types supported as table columns.
TYPE_NAME VARCHAR the canonical name for DDL statements.
DATA_TYPE SMALLINT data type code from DITypes.
PRECISION INTEGER max column size.
number => max precision.
character => max characters.
datetime => max chars incl. | Table | SYSTEM_USERS() Retrieves a Table object describing the
visible Users defined within this database. | final protected void | addColumn(Table t, String name, int type, int size, boolean nullable) Adds a Column object with the specified name, data type,
data size and nullability to the specified Table
object. | final protected void | addColumn(Table t, String name, int type, boolean nullable) Adds a Column object with the specified name, data type
and nullability to the specified Table object. | final protected void | addColumn(Table t, String name, int type) Adds a nullable Column object with the specified name and
data type to the specified Table object. | final protected Iterator | allTables() Retrieves an enumeration over all of the tables in this database.
This means all user tables, views, system tables, system views,
including temporary and text tables. | final protected void | cacheClear() Clears the contents of cached system tables and resets user slots
to null. | final protected Table | createBlankTable(HsqlName name) Creates a new primoidal system table with the specified name. | protected Table | generateTable(int tableIndex) Retrieves the system table corresponding to the specified
tableIndex value. | final Table | getSystemTable(Session session, String name) Retrieves the system Table object corresponding to
the given name and session arguments. | final protected void | init() One time initialisation of instance attributes
at construction time. | final protected boolean | isAccessibleTable(Table table) Retrieves whether any form of SQL access is allowed against the
the specified table w.r.t the database access rights
assigned to current Session object's User. |
columnNameMap | final protected static HashMap columnNameMap(Code) | | Map: simple Column name String object =>
HsqlName object.
|
nonCachedTablesSet | final protected static HashSet nonCachedTablesSet(Code) | | Set: { names of system tables that are not to be cached }
|
session | protected Session session(Code) | | The Session object under consideration in the current
executution context.
|
sysTableHsqlNames | final protected static HsqlName[] sysTableHsqlNames(Code) | | The HsqlNames of the system tables.
|
sysTableSessionDependent | final protected boolean[] sysTableSessionDependent(Code) | | true if the contents of a cached system table depends on the session
|
sysTableSessions | final protected int[] sysTableSessions(Code) | | Current user for each cached system table
|
sysTables | final protected Table[] sysTables(Code) | | cache of system tables
|
tableTypes | final protected static String[] tableTypes(Code) | | The table types HSQLDB supports.
|
DatabaseInformationMain | DatabaseInformationMain(Database db) throws HsqlException(Code) | | Constructs a table producer which provides system tables
for the specified Database object.
Note: before 1.7.2 Alpha N, it was important to observe that
by specifying an instance of this class or one of its descendents to
handle system table production, the new set of builtin permissions
and aliases would overwrite those of an existing database, meaning that
metadata reporting might have been rendered less secure if the same
database were then opened again using a lower numbered system table
producer instance (i.e. one in a 1.7.1 or earlier distribution).
As of 1.7.2 Alpha N, system-generated permissions and aliases are no
longer recorded in the checkpoint script, obseleting this issue.
Checkpointing of system-generated grants and aliases was removed
because their existence is very close to a core requirment for correct
operation and they are reintroduced to the system at each startup.
In a future release, it may even be an exception condition to attempt
to remove or alter system-generated grants and aliases,
respectvely.
Parameters: db - the Database object for which this objectproduces system tables throws: HsqlException - if a database access error occurs |
SYSTEM_ALLTYPEINFO | final Table SYSTEM_ALLTYPEINFO() throws HsqlException(Code) | | Retrieves a Table object describing, in an extended
fashion, all of the system or formal specification SQL types known to
this database, including its level of support for them (which may
be no support at all) in various capacities.
TYPE_NAME VARCHAR the canonical name used in DDL statements.
DATA_TYPE SMALLINT data type code from Types
PRECISION INTEGER max column size.
number => max. precision.
character => max characters.
datetime => max chars incl. frac. component.
LITERAL_PREFIX VARCHAR char(s) prefixing literal of this type.
LITERAL_SUFFIX VARCHAR char(s) terminating literal of this type.
CREATE_PARAMS VARCHAR Localized syntax-order list of domain
create parameter keywords.
- for human consumption only
NULLABLE SMALLINT { No Nulls | Nullable | Unknown }
CASE_SENSITIVE BOOLEAN case-sensitive in collations/comparisons?
SEARCHABLE SMALLINT { None | Char (Only WHERE .. LIKE) |
Basic (Except WHERE .. LIKE) |
Searchable (All forms) }
UNSIGNED_ATTRIBUTE BOOLEAN { TRUE (unsigned) | FALSE (signed) |
NULL (non-numeric or not applicable) }
FIXED_PREC_SCALE BOOLEAN { TRUE (fixed) | FALSE (variable) |
NULL (non-numeric or not applicable) }
AUTO_INCREMENT BOOLEAN automatic unique value generated for
inserts and updates when no value or
NULL specified?
LOCAL_TYPE_NAME VARCHAR Localized name of data type;
- NULL => not supported (no resource avail).
- for human consumption only
MINIMUM_SCALE SMALLINT minimum scale supported.
MAXIMUM_SCALE SMALLINT maximum scale supported.
SQL_DATA_TYPE INTEGER value expected in SQL CLI SQL_DESC_TYPE
field of the SQLDA.
SQL_DATETIME_SUB INTEGER SQL CLI datetime/interval subcode
NUM_PREC_RADIX INTEGER numeric base w.r.t # of digits reported
in PRECISION column (typically 10)
INTERVAL_PRECISION INTEGER interval leading precision (not implemented)
AS_TAB_COL BOOLEAN type supported as table column?
AS_PROC_COL BOOLEAN type supported as procedure column?
MAX_PREC_ACT BIGINT like PRECISION unless value would be
truncated using INTEGER
MIN_SCALE_ACT INTEGER like MINIMUM_SCALE unless value would be
truncated using SMALLINT
MAX_SCALE_ACT INTEGER like MAXIMUM_SCALE unless value would be
truncated using SMALLINT
COL_ST_CLS_NAME VARCHAR Java Class FQN of in-memory representation
COL_ST_IS_SUP BOOLEAN is COL_ST_CLS_NAME supported under the
hosting JVM and engine build option?
STD_MAP_CLS_NAME VARCHAR Java class FQN of standard JDBC mapping
STD_MAP_IS_SUP BOOLEAN Is STD_MAP_CLS_NAME supported under the
hosting JVM?
CST_MAP_CLS_NAME VARCHAR Java class FQN of HSQLDB-provided JDBC
interface representation
CST_MAP_IS_SUP BOOLEAN is CST_MAP_CLS_NAME supported under the
hosting JVM and engine build option?
MCOL_JDBC INTEGER maximum character octet length representable
via JDBC interface
MCOL_ACT BIGINT like MCOL_JDBC unless value would be
truncated using INTEGER
DEF_OR_FIXED_SCALE INTEGER default or fixed scale for numeric types
REMARKS VARCHAR localized comment on the data type
TYPE_SUB INTEGER From Types:
{TYPE_SUB_DEFAULT | TYPE_SUB_IGNORECASE}
deprecated: TYPE_SUB_IDENTITY
a Table object describing all of thestandard SQL types known to this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_BESTROWIDENTIFIER | final Table SYSTEM_BESTROWIDENTIFIER() throws HsqlException(Code) | | Retrieves a Table object describing the optimal
set of visible columns that uniquely identifies a row
for each accessible table defined within this database.
Each row describes a single column of the best row indentifier column
set for a particular table. Each row has the following
columns:
SCOPE SMALLINT scope of applicability
COLUMN_NAME VARCHAR simple name of the column
DATA_TYPE SMALLINT SQL data type from Types
TYPE_NAME VARCHAR canonical type name
COLUMN_SIZE INTEGER precision
BUFFER_LENGTH INTEGER transfer size in bytes, if definitely known
DECIMAL_DIGITS SMALLINT scale - fixed # of decimal digits
PSEUDO_COLUMN SMALLINT is this a pseudo column like an Oracle ROWID?
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR simple name of table schema
TABLE_NAME VARCHAR simple table name
NULLABLE SMALLINT is column nullable?
IN_KEY BOOLEAN column belongs to a primary or alternate key?
Notes:
jdbcDatabaseMetaData.getBestRowIdentifier uses its
nullable parameter to filter the rows of this table in the following
manner:
If the nullable parameter is false , then rows are reported
only if, in addition to satisfying the other specified filter values,
the IN_KEY column value is TRUE. If the nullable parameter is
true , then the IN_KEY column value is ignored.
There is not yet infrastructure in place to make some of the ranking
descisions described below, and it is anticipated that mechanisms
upon which cost descisions could be based will change significantly over
the next few releases. Hence, in the interest of simplicity and of not
making overly complex dependency on features that will almost certainly
change significantly in the near future, the current implementation,
while perfectly adequate for all but the most demanding or exacting
purposes, is actually sub-optimal in the strictest sense.
A description of the current implementation follows:
DEFINTIONS:
Alternate key
- An attribute of a table that, by virtue of its having a set of
columns that are both the full set of columns participating in a
unique constraint or index and are all not null, yeilds the same
selectability characteristic that would obtained by declaring a
primary key on those same columns.
Column set performance ranking
- The ranking of the expected average performance w.r.t a subset of
a table's columns used to select and/or compare rows, as taken in
relation to all other distinct candidate subsets under
consideration. This can be estimated by comparing each cadidate
subset in terms of total column count, relative peformance of
comparisons amongst the domains of the columns and differences
in other costs involved in the execution plans generated using
each subset under consideration for row selection/comparison.
Rules:
Given the above definitions, the rules currently in effect for reporting
best row identifier are as follows, in order of precedence:
- if the table under consideration has a primary key contraint, then
the columns of the primary key are reported, with no consideration
given to the column set performance ranking over the set of
candidate keys. Each row has its IN_KEY column set to TRUE.
- if 1.) does not hold, then if there exits one or more alternate
keys, then the columns of the alternate key with the lowest column
count are reported, with no consideration given to the column set
performance ranking over the set of candidate keys. If there
exists a tie for lowest column count, then the columns of the
first such key encountered are reported.
Each row has its IN_KEY column set to TRUE.
- if both 1.) and 2.) do not hold, then, if possible, a unique
contraint/index is selected from the set of unique
contraints/indices containing at least one column having
a not null constraint, with no consideration given to the
column set performance ranking over the set of all such
candidate column sets. If there exists a tie for lowest non-zero
count of columns having a not null constraint, then the columns
of the first such encountered candidate set are reported. Each
row has its IN_KEY column set to FALSE.
- Finally, if the set of candidate column sets in 3.) is the empty,
then no column set is reported for the table under consideration.
The scope reported for a best row identifier column set is determined
thus:
- if the database containing the table under consideration is in
read-only mode or the table under consideration is GLOBAL TEMPORARY
(a TEMP or TEMP TEXT table, in HSQLDB parlance), then the scope
is reported as
java.sql.DatabaseMetaData.bestRowSession .
- if 1.) does not hold, then the scope is reported as
java.sql.DatabaseMetaData.bestRowTemporary .
a Table object describing the optimalset of visible columns that uniquely identifies a rowfor each accessible table defined within this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_CATALOGS | final Table SYSTEM_CATALOGS() throws HsqlException(Code) | | Retrieves a Table object naming the accessible catalogs
defined within this database.
Each row is a catalog name description with the following column:
TABLE_CAT VARCHAR catalog name
a Table object naming the accessiblecatalogs defined within this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_CHECK_CONSTRAINTS | final Table SYSTEM_CHECK_CONSTRAINTS() throws HsqlException(Code) | | The SYSTEM_CHECK_CONSTRAINTS table has one row for each domain
constraint, table check constraint, and assertion.
Definition:
CREATE TABLE SYSTEM_CHECK_CONSTRAINTS (
CONSTRAINT_CATALOG VARCHAR NULL,
CONSTRAINT_SCHEMA VARCHAR NULL,
CONSTRAINT_NAME VARCHAR NOT NULL,
CHECK_CLAUSE VARCHAR NOT NULL,
UNIQUE ( CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME )
)
Description:
- The values of CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA and
CONSTRAINT_NAME are the catalog name, unqualified schema name,
and qualified identifier, respectively, of the constraint being
described.
- Case:
a) |
If the character representation of the
<search condition> contained in the
<check constraint definition>,
<domain constraint definition>, or
<assertion definition> that defined
the check constraint being described can be
represented without truncation, then the
value of CHECK_CLAUSE is that character
representation. |
b) |
Otherwise, the value of CHECK_CLAUSE is the
null value. |
|
SYSTEM_COLUMNPRIVILEGES | final Table SYSTEM_COLUMNPRIVILEGES() throws HsqlException(Code) | | Retrieves a Table object describing the visible
access rights for all visible columns of all accessible
tables defined within this database.
Each row is a column privilege description with the following
columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
COLUMN_NAME VARCHAR column name
GRANTOR VARCHAR grantor of access
GRANTEE VARCHAR grantee of access
PRIVILEGE VARCHAR name of access
IS_GRANTABLE VARCHAR grantable?: "YES" - grant to others, else "NO"
Note: As of 1.7.2, HSQLDB does not support column level
privileges. However, it does support table-level privileges, so they
are reflected here. That is, the content of this table is equivalent
to a projection of SYSTEM_TABLEPRIVILEGES and SYSTEM_COLUMNS joined by
full table identifier.
a Table object describing the visibleaccess rights for all visible columns ofall accessible tables defined within thisdatabase throws: HsqlException - if an error occurs while producing the table |
SYSTEM_COLUMNS | final Table SYSTEM_COLUMNS() throws HsqlException(Code) | | Retrieves a Table object describing the
visible columns of all accessible tables defined
within this database.
Each row is a column description with the following columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
COLUMN_NAME VARCHAR column name
DATA_TYPE SMALLINT SQL type from DITypes
TYPE_NAME VARCHAR canonical type name
COLUMN_SIZE INTEGER column size (length/precision)
BUFFER_LENGTH INTEGER transfer size in bytes, if definitely known
DECIMAL_DIGITS INTEGER # of fractional digits (scale)
NUM_PREC_RADIX INTEGER Radix
NULLABLE INTEGER is NULL allowed? (from DatabaseMetaData)
REMARKS VARCHAR comment describing column
COLUMN_DEF VARCHAR default value (possibly expression)
SQL_DATA_TYPE VARCHAR type code as expected in the SQL CLI SQLDA
SQL_DATETIME_SUB INTEGER the SQL CLI subtype for DATETIME types
CHAR_OCTET_LENGTH INTEGER for char types, max # of bytes in column
ORDINAL_POSITION INTEGER 1-based index of column in table
IS_NULLABLE VARCHAR is column nullable? ("YES"|"NO"|""}
SCOPE_CATLOG VARCHAR catalog of REF attribute scope table
SCOPE_SCHEMA VARCHAR schema of REF attribute scope table
SCOPE_TABLE VARCHAR name of REF attribute scope table
SOURCE_DATA_TYPE VARCHAR source type of REF attribute
TYPE_SUB INTEGER HSQLDB data subtype code
a Table object describing thevisible columns of all accessibletables defined within this database. throws: HsqlException - if an error occurs while producing the table
|
SYSTEM_CROSSREFERENCE | final Table SYSTEM_CROSSREFERENCE() throws HsqlException(Code) | | Retrieves a Table object describing, for each
accessible referencing and referenced table, how the referencing
tables import, for the purposes of referential integrity,
the columns of the referenced tables.
Each row is a foreign key column description with the following
columns:
PKTABLE_CAT VARCHAR referenced table catalog
PKTABLE_SCHEM VARCHAR referenced table schema
PKTABLE_NAME VARCHAR referenced table name
PKCOLUMN_NAME VARCHAR referenced column name
FKTABLE_CAT VARCHAR referencing table catalog
FKTABLE_SCHEM VARCHAR referencing table schema
FKTABLE_NAME VARCHAR referencing table name
FKCOLUMN_NAME VARCHAR referencing column
KEY_SEQ SMALLINT sequence number within foreign key
UPDATE_RULE SMALLINT
{ Cascade | Set Null | Set Default | Restrict (No Action)}?
DELETE_RULE SMALLINT
{ Cascade | Set Null | Set Default | Restrict (No Action)}?
FK_NAME VARCHAR foreign key constraint name
PK_NAME VARCHAR primary key or unique constraint name
DEFERRABILITY SMALLINT
{ initially deferred | initially immediate | not deferrable }
a Table object describing how accessible tablesimport other accessible tables' primary key and/or uniqueconstraint columns throws: HsqlException - if an error occurs while producing the table |
SYSTEM_INDEXINFO | final Table SYSTEM_INDEXINFO() throws HsqlException(Code) | | Retrieves a Table object describing the visible
Index objects for each accessible table defined
within this database.
Each row is an index column description with the following
columns:
TABLE_CAT VARCHAR table's catalog
TABLE_SCHEM VARCHAR simple name of table's schema
TABLE_NAME VARCHAR simple name of the table using the index
NON_UNIQUE BOOLEAN can index values be non-unique?
INDEX_QUALIFIER VARCHAR catalog in which the index is defined
INDEX_NAME VARCHAR simple name of the index
TYPE SMALLINT index type: { Clustered | Hashed | Other }
ORDINAL_POSITION SMALLINT column sequence number within index
COLUMN_NAME VARCHAR simple column name
ASC_OR_DESC VARCHAR col. sort sequence: {"A" (Asc) | "D" (Desc)}
CARDINALITY INTEGER # of unique values in index (not implemented)
PAGES INTEGER index page use (not implemented)
FILTER_CONDITION VARCHAR filter condition, if any (not implemented)
// HSQLDB-extension
ROW_CARDINALITY INTEGER total # of rows in index (not implemented)
a Table object describing the visibleIndex objects for each accessibletable defined within this database. throws: HsqlException - if an error occurs while producing the table |
SYSTEM_PRIMARYKEYS | final Table SYSTEM_PRIMARYKEYS() throws HsqlException(Code) | | Retrieves a Table object describing the visible
primary key columns of each accessible table defined within
this database.
Each row is a PRIMARY KEY column description with the following
columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
COLUMN_NAME VARCHAR column name
KEY_SEQ SMALLINT sequence number within primary key
PK_NAME VARCHAR primary key constraint name
a Table object describing the visibleprimary key columns of each accessible tabledefined within this database. throws: HsqlException - if an error occurs while producing the table |
SYSTEM_PROCEDURECOLUMNS | Table SYSTEM_PROCEDURECOLUMNS() throws HsqlException(Code) | | Retrieves a Table object describing the
return, parameter and result columns of the accessible
routines defined within this database.
Each row is a procedure column description with the following
columns:
PROCEDURE_CAT VARCHAR routine catalog
PROCEDURE_SCHEM VARCHAR routine schema
PROCEDURE_NAME VARCHAR routine name
COLUMN_NAME VARCHAR column/parameter name
COLUMN_TYPE SMALLINT kind of column/parameter
DATA_TYPE SMALLINT SQL type from DITypes
TYPE_NAME VARCHAR SQL type name
PRECISION INTEGER precision (length) of type
LENGTH INTEGER transfer size, in bytes, if definitely known
(roughly equivalent to BUFFER_SIZE for table
columns)
SCALE SMALLINT scale
RADIX SMALLINT radix
NULLABLE SMALLINT can column contain NULL?
REMARKS VARCHAR explanatory comment on column
SPECIFIC_NAME VARCHAR typically (but not restricted to) a
fully qualified Java Method name and signature
SEQ INTEGER The JDBC-specified order within
runs of PROCEDURE_SCHEM, PROCEDURE_NAME,
SPECIFIC_NAME, which is:
return value (0), if any, first, followed
by the parameter descriptions in call order
(1..n1), followed by the result column
descriptions in column number order
(n1 + 1..n1 + n2)
a Table object describing thereturn, parameter and result columnsof the accessible routines definedwithin this database. throws: HsqlException - if an error occurs while producing the table |
SYSTEM_PROCEDURES | Table SYSTEM_PROCEDURES() throws HsqlException(Code) | | Retrieves a Table object describing the accessible
routines defined within this database.
Each row is a procedure description with the following
columns:
PROCEDURE_CAT VARCHAR catalog in which routine is defined
PROCEDURE_SCHEM VARCHAR schema in which routine is defined
PROCEDURE_NAME VARCHAR simple routine identifier
NUM_INPUT_PARAMS INTEGER number of input parameters
NUM_OUTPUT_PARAMS INTEGER number of output parameters
NUM_RESULT_SETS INTEGER number of result sets returned
REMARKS VARCHAR explanatory comment on the routine
PROCEDURE_TYPE SMALLINT { Unknown | No Result | Returns Result }
ORIGIN VARCHAR {ALIAS |
[BUILTIN | USER DEFINED] ROUTINE |
[BUILTIN | USER DEFINED] TRIGGER |
...}
SPECIFIC_NAME VARCHAR typically (but not restricted to) a
fully qualified Java Method name
and signature
a Table object describing the accessibleroutines defined within the this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_SCHEMAS | final Table SYSTEM_SCHEMAS() throws HsqlException(Code) | | Retrieves a Table object describing the accessible schemas
defined within this database.
Each row is a schema description with the following
columns:
TABLE_SCHEM VARCHAR simple schema name
TABLE_CATALOG VARCHAR catalog in which schema is defined
IS_DEFAULT BOOLEAN is the schema the default for new sessions
table containing information about schemas definedwithin this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_SEQUENCES | final Table SYSTEM_SEQUENCES() throws HsqlException(Code) | | The SYSTEM_SEQUENCES table has one row for each external sequence
generator.
Definition:
CREATE TABLE SYSTEM_SEQUENCES (
SEQUENCE_CATALOG VARCHAR NULL,
SEQUENCE_SCHEMA VARCHAR NULL,
SEQUENCE_NAME VARCHAR NOT NULL,
DTD_IDENTIFIER VARCHAR NOT NULL,
MAXIMUM_VALUE VARCHAR NOT NULL,
MINIMUM_VALUE VARCHAR NOT NULL,
INCREMENT VARCHAR NOT NULL,
CYCLE_OPTION VARCHAR NOT NULL,
START_WITH VARCHAR NOT NULL,
CHECK(CYCLE_OPTION IN('YES', 'NO')),
CHECK(CAST(START_WITH AS BIGINT)
BETWEEN CAST(MINIMUM_VALUE AS BIGINT)
AND CAST(MAXIMUM_VALUE AS BIGINT)),
UNIQUE(SEQUENCE_CATALOG, SEQUENCE_SCHEMA, SEQUENCE_NAME)
)
DESCRIPTION:
- The values of SEQUENCE_CATALOG, SEQUENCE_SCHEMA, and
SEQUENCE_NAME are the catalog name, unqualified schema name,
and qualified identifier, respectively, of the sequence generator
being described.
- The values of SEQUENCE_CATALOG, SEQUENCE_SCHEMA, SEQUENCE_NAME, and
DTD_IDENTIFIER are the values of OBJECT_CATALOG, OBJECT_SCHEMA,
OBJECT_NAME, and DTD_IDENTIFIER, respectively, of the row in
DATA_TYPE_DESCRIPTOR (not yet implemented) that describes the data
type of the sequence generator.
- The values of MAXIMUM_VALUE, MINIMUM_VALUE, and INCREMENT are the
character representations of maximum value, minimum value,
and increment, respectively, of the sequence generator being
described.
- The values of CYCLE_OPTION have the following meanings:
YES |
The cycle option of the sequence generator
is CYCLE. |
NO |
The cycle option of the sequence generator is
NO CYCLE. |
- The value of START_WITH is HSQLDB-specific (not in the SQL 200n
spec).
It is the character representation of the START WITH clause
value that would be required to recreate or ALTER RESET START WITH
the described SEQUENCE, such that its behaviour would be identical
to that exhibited at the instant this table is materialized in the
session context.
In short, this is the character representation of value that
would be generated by NEXT VALUE FOR at the instant this table
is materialized in session context.
|
SYSTEM_TABLEPRIVILEGES | final Table SYSTEM_TABLEPRIVILEGES() throws HsqlException(Code) | | Retrieves a Table object describing the visible access
rights for each accessible table definied within this database.
Each row is a table privilege description with the following columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
GRANTOR VARCHAR grantor of access
GRANTEE VARCHAR grantee of access
PRIVILEGE VARCHAR { "SELECT" | "INSERT" | "UPDATE" | "DELETE" }
IS_GRANTABLE VARCHAR { "YES" | "NO" | NULL (unknown) }
Note: Up to and including HSQLDB 1.7.2, the access rights granted
on a table apply to all of the columns of that table as well.
a Table object describing the visibleaccess rights for each accessible tabledefined within this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_TABLES | final Table SYSTEM_TABLES() throws HsqlException(Code) | | Retrieves a Table object describing the accessible
tables defined within this database.
Each row is a table description with the following columns:
TABLE_CAT VARCHAR table catalog
TABLE_SCHEM VARCHAR table schema
TABLE_NAME VARCHAR table name
TABLE_TYPE VARCHAR {"TABLE" | "VIEW" |
"SYSTEM TABLE" | "GLOBAL TEMPORARY"}
REMARKS VARCHAR comment on the table.
TYPE_CAT VARCHAR table type catalog (not implemented).
TYPE_SCHEM VARCHAR table type schema (not implemented).
TYPE_NAME VARCHAR table type name (not implemented).
SELF_REFERENCING_COL_NAME VARCHAR designated "identifier" column of
typed table (not implemented).
REF_GENERATION VARCHAR {"SYSTEM" | "USER" |
"DERIVED" | NULL } (not implemented)
HSQLDB_TYPE VARCHAR HSQLDB-specific type:
{"MEMORY" | "CACHED" | "TEXT" | ...}
READ_ONLY BOOLEAN TRUE if table is read-only,
else FALSE.
a Table object describing the accessibletables defined within this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_TABLETYPES | Table SYSTEM_TABLETYPES() throws HsqlException(Code) | | Retrieves a Table object describing the table types
available in this database.
In general, the range of values that may be commonly encounted across
most DBMS implementations is:
- "TABLE"
- "VIEW"
- "SYSTEM TABLE"
- "GLOBAL TEMPORARY"
- "LOCAL TEMPORARY"
- "ALIAS"
- "SYNONYM"
As of HSQLDB 1.7.2, the engine supports and thus this method reports
only a subset of the range above:
- "TABLE"
(HSQLDB MEMORY, CACHED and TEXT tables)
- "VIEW" (Views)
- "SYSTEM TABLE"
(The tables generated by this object)
- "GLOBAL TEMPORARY"
(HSQLDB TEMP and TEMP TEXT tables)
a Table object describing the table typesavailable in this database throws: HsqlException - if an error occurs while producing the table |
SYSTEM_TYPEINFO | final Table SYSTEM_TYPEINFO() throws HsqlException(Code) | | Retrieves a Table object describing the
result expected by the JDBC DatabaseMetaData interface implementation
for system-defined SQL types supported as table columns.
TYPE_NAME VARCHAR the canonical name for DDL statements.
DATA_TYPE SMALLINT data type code from DITypes.
PRECISION INTEGER max column size.
number => max precision.
character => max characters.
datetime => max chars incl. frac. component.
LITERAL_PREFIX VARCHAR char(s) prefixing literal of this type.
LITERAL_SUFFIX VARCHAR char(s) terminating literal of this type.
CREATE_PARAMS VARCHAR Localized syntax-order list of domain
create parameter keywords.
- for human consumption only
NULLABLE SMALLINT {No Nulls | Nullable | Unknown}
CASE_SENSITIVE BOOLEAN case-sensitive in collations/comparisons?
SEARCHABLE SMALLINT {None | Char (Only WHERE .. LIKE) |
Basic (Except WHERE .. LIKE) |
Searchable (All forms)}
UNSIGNED_ATTRIBUTE BOOLEAN {TRUE (unsigned) | FALSE (signed) |
NULL (non-numeric or not applicable)}
FIXED_PREC_SCALE BOOLEAN {TRUE (fixed) | FALSE (variable) |
NULL (non-numeric or not applicable)}
AUTO_INCREMENT BOOLEAN automatic unique value generated for
inserts and updates when no value or
NULL specified?
LOCAL_TYPE_NAME VARCHAR localized name of data type;
- NULL if not supported.
- for human consuption only
MINIMUM_SCALE SMALLINT minimum scale supported.
MAXIMUM_SCALE SMALLINT maximum scale supported.
SQL_DATA_TYPE INTEGER value expected in SQL CLI SQL_DESC_TYPE
field of the SQLDA.
SQL_DATETIME_SUB INTEGER SQL CLI datetime/interval subcode.
NUM_PREC_RADIX INTEGER numeric base w.r.t # of digits reported in
PRECISION column (typically 10).
TYPE_SUB INTEGER From DITypes:
{TYPE_SUB_DEFAULT | TYPE_SUB_IDENTITY |
TYPE_SUB_IGNORECASE}
a Table object describing thesystem-defined SQL types supported as table columns throws: HsqlException - if an error occurs while producing the table |
SYSTEM_USERS | Table SYSTEM_USERS() throws HsqlException(Code) | | Retrieves a Table object describing the
visible Users defined within this database.
table containing information about the users defined withinthis database throws: HsqlException - if an error occurs while producing the table |
addColumn | final protected void addColumn(Table t, String name, int type, int size, boolean nullable) throws HsqlException(Code) | | Adds a Column object with the specified name, data type,
data size and nullability to the specified Table
object.
Parameters: t - the table to which to add the specified column Parameters: name - the name of the column Parameters: type - the data type of the column Parameters: size - the precision/length of the column Parameters: nullable - true if the column is to allow null values,else false throws: HsqlException - if a problem occurs when adding thecolumn (e.g. duplicate name) |
addColumn | final protected void addColumn(Table t, String name, int type, boolean nullable) throws HsqlException(Code) | | Adds a Column object with the specified name, data type
and nullability to the specified Table object.
Parameters: t - the table to which to add the specified column Parameters: name - the name of the column Parameters: type - the data type of the column Parameters: nullable - true if the column is to allow null values,else false throws: HsqlException - if a problem occurs when adding thecolumn (e.g. duplicate name) |
addColumn | final protected void addColumn(Table t, String name, int type) throws HsqlException(Code) | | Adds a nullable Column object with the specified name and
data type to the specified Table object.
Parameters: t - the table to which to add the specified column Parameters: name - the name of the column Parameters: type - the data type of the column throws: HsqlException - if a problem occurs when adding thecolumn (e.g. duplicate name) |
allTables | final protected Iterator allTables()(Code) | | Retrieves an enumeration over all of the tables in this database.
This means all user tables, views, system tables, system views,
including temporary and text tables.
an enumeration over all of the tables in this database |
cacheClear | final protected void cacheClear() throws HsqlException(Code) | | Clears the contents of cached system tables and resets user slots
to null.
throws: HsqlException - if a database access error occurs |
createBlankTable | final protected Table createBlankTable(HsqlName name) throws HsqlException(Code) | | Creates a new primoidal system table with the specified name.
a new system table Parameters: name - of the table throws: HsqlException - if a database access error occurs |
generateTable | protected Table generateTable(int tableIndex) throws HsqlException(Code) | | Retrieves the system table corresponding to the specified
tableIndex value.
Parameters: tableIndex - int value identifying the system table to generate throws: HsqlException - if a database access error occurs the system table corresponding to the specified tableIndex value |
getSystemTable | final Table getSystemTable(Session session, String name) throws HsqlException(Code) | | Retrieves the system Table object corresponding to
the given name and session arguments.
Parameters: session - the Session object requesting the table Parameters: name - a String identifying the desired table throws: HsqlException - if there is a problem producing the table or adatabase access error occurs a system table corresponding to the name andsession arguments |
init | final protected void init() throws HsqlException(Code) | | One time initialisation of instance attributes
at construction time.
throws: HsqlException - if a database access error occurs |
isAccessibleTable | final protected boolean isAccessibleTable(Table table) throws HsqlException(Code) | | Retrieves whether any form of SQL access is allowed against the
the specified table w.r.t the database access rights
assigned to current Session object's User.
true if the table is accessible, else false Parameters: table - the table for which to check accessibility throws: HsqlException - if a database access error occurs |
|
|