| java.lang.Object org.executequery.databasemediators.MetaDataValues
MetaDataValues | public class MetaDataValues implements ConnectionListener(Code) | | This class provides access to the current connection's
database meta data. Each method performs specific requests
as may be required by the calling object to display the
relevant data usually within a table or similar widget.
Depending on the calling class and its requirements,
the connection to the database may be left open thereby
removing the overhead associated with connection retrieval -
as in the case of the Database Browser which makes frequent
database access requests. Other objects not requiring a
dedicated connection simply choose not to maintain one and
make their requests as required.
author: Takis Diakoumis version: $Revision: 1.15 $ |
Constructor Summary | |
public | MetaDataValues() Constructs a new instance where the conection
is returned following each request. | public | MetaDataValues(boolean keepAlive) Constructs a new instance where the conection
is returned following each request only if the
passed boolean value is 'false'. | public | MetaDataValues(DatabaseConnection databaseConnection, boolean keepAlive) |
Method Summary | |
public void | closeConnection() Closes the open connection and releases
all resources attached to it. | public void | connected(ConnectionEvent connectionEvent) Indicates a connection has been established. | public void | disconnected(ConnectionEvent connectionEvent) Indicates a connection has been closed. | public String | getCatalogName() | public ColumnData[] | getColumnMetaData(String tableName, String schemaName) Retrieves complete and detailed meta data for all columns
within the specified table and schema.
The meta data will include data type, size and all
primary and foreign keys for the specified table. | public ColumnData[] | getColumnMetaData(String catalog, String schema, String name) | public Vector<ColumnData> | getColumnMetaDataVector(String name, String schema, String catalog) | public Vector<ColumnData> | getColumnMetaDataVector(String name, String schema) Retrieves the complete column meta data
for the specified database table and schema. | public String[] | getColumnNames(String table, String schema) Retrieves the column names for the specified
database table and schema as an array. | public Vector<String> | getColumnNamesVector(String table, String schema) Retrieves the column names for the specified
database table and schema as a Vector
object. | public Map | getColumnProperties(String schema, String table, String column) Retrieves the column names for the specified
database table and schema as an array. | public String | getDataSourceName() Retrieves the connected data source name. | public String[] | getDataTypesArray() Retrieves the database SQL data type names only. | public ResultSet | getDataTypesResultSet() Retrieves the database SQL data types as a
ResultSet object. | public String[] | getDatabaseKeywords() Retrieves the connected databases SQL keyword
list via a call to the DatabaseMetaData
object's getSQLKeywords() method. | public String | getDatabaseProductName() Retrieves the database product name from
the connection's meta data. | public String | getDatabaseProductNameVersion() Retrieves the database product version from
the connection's meta data. | public String | getDatabaseProductVersion() Retrieves the database product version from
the connection's meta data. | public Hashtable | getDatabaseProperties() Retrieves key/value type pairs using the
Reflection API to call and retrieve
values from the connection's meta data object's methods
and variables. | public Vector | getDatabaseTablesVector() Retrieves the currently connected schema's
database table names within a Vector . | public String[] | getExportedKeyTables(String catalog, String schema, String table) | public String | getHost() Retrieves the connected host name. | public List | getHostedCatalogSchemas() | public Vector<String> | getHostedCatalogsVector() Retrieves the current connection's hosted
schema names. | public Vector<String> | getHostedSchemasVector() Retrieves the current connection's hosted
schema names. | public String[] | getImportedKeyTables(String catalog, String schema, String table) | public int | getPort() Retrieves the connected port number. | public TablePrivilege[] | getPrivileges(String catalog, String schema, String table) | public DatabaseProcedure | getProcedureColumns(String schema, String name) | public DatabaseProcedure | getProcedureColumns(String catalog, String schema, String name) | public String[] | getProcedureNames(String catalog, String schema, String name) | public String | getProcedureTerm() Returns the procedure term used in the current connected
database. | public DatabaseProcedure[] | getProcedures(String schema, String[] names) | public DatabaseProcedure[] | getProcedures(String catalog, String schema, String[] names) | public String | getSchemaName() Retrieves the connected schema name. | public Vector<String> | getSchemaTables(String schema) Retrieves the specified schema's
database table names within a Vector . | public DatabaseProcedure[] | getStoredObjects(String schema, String[] types) | public DatabaseProcedure[] | getStoredObjects(String catalog, String schema, String[] types) | public String[] | getSystemFunctions(int type) | public ResultSet | getTableData(String schema, String table) Retrieves the data in its entirety from the specified table
using SELECT * FROM table_name . | public int | getTableDataRowCount(String schema, String table) Retrieves the table data row count for the specified table. | public Vector<ColumnIndex> | getTableIndexes(String catalog, String schema, String table) Retrieves a Vector of ColumnIndexData
objects containing all relevant information on the table indexes
for the specified table. | public ResultSet | getTableMetaData(String catalog, String schema, String name) Returns the table column meta data as a result set. | public String[] | getTableTypes() | public DatabaseObject[] | getTables(String catalog, String schema, String[] types) | public String[] | getTables(String catalog, String schema, String metaType) | public String | getURL() Retrieves the connected JDBC URL. | public String | getUser() Retrieves the connected user. | public boolean | hasStoredObjects(String schema, String[] types) | public boolean | hasStoredObjects(String catalog, String schema, String[] types) | public void | recycleConnection(DatabaseConnection dc) Recycles the specified connection object. | public void | setDatabaseConnection(DatabaseConnection dc) Sets the database connection object to that specified. |
NUMERIC_FUNCTIONS | final public static int NUMERIC_FUNCTIONS(Code) | | |
STRING_FUNCTIONS | final public static int STRING_FUNCTIONS(Code) | | |
TIME_DATE_FUNCTIONS | final public static int TIME_DATE_FUNCTIONS(Code) | | |
MetaDataValues | public MetaDataValues()(Code) | | Constructs a new instance where the conection
is returned following each request.
|
MetaDataValues | public MetaDataValues(boolean keepAlive)(Code) | | Constructs a new instance where the conection
is returned following each request only if the
passed boolean value is 'false'. Otherwise the
connection is initialised and maintained following
the first request and reused for any subsequent requests.
Parameters: whether - to keep the connection open |
closeConnection | public void closeConnection()(Code) | | Closes the open connection and releases
all resources attached to it.
|
connected | public void connected(ConnectionEvent connectionEvent)(Code) | | Indicates a connection has been established.
Parameters: the - encapsulating event |
disconnected | public void disconnected(ConnectionEvent connectionEvent)(Code) | | Indicates a connection has been closed.
Parameters: the - encapsulating event |
getColumnMetaData | public ColumnData[] getColumnMetaData(String tableName, String schemaName) throws DataSourceException(Code) | | Retrieves complete and detailed meta data for all columns
within the specified table and schema.
The meta data will include data type, size and all
primary and foreign keys for the specified table. The results
of this method are specifically displayed within the Database
Browser feature for each selected table from the browser's
tree structure.
Parameters: the - table name Parameters: the - schema name the column meta data as a ColumnData array |
getColumnMetaDataVector | public Vector<ColumnData> getColumnMetaDataVector(String name, String schema) throws DataSourceException(Code) | | Retrieves the complete column meta data
for the specified database table and schema.
Each column and associated data is stored within
ColumnData objects and added to the
Vector object to be returned.
Parameters: the - database table name Parameters: the - database schema name the table column meta data |
getColumnNames | public String[] getColumnNames(String table, String schema) throws DataSourceException(Code) | | Retrieves the column names for the specified
database table and schema as an array.
Parameters: the - database table name Parameters: the - database schema name the column names array |
getColumnNamesVector | public Vector<String> getColumnNamesVector(String table, String schema) throws DataSourceException(Code) | | Retrieves the column names for the specified
database table and schema as a Vector
object.
Parameters: the - database table name Parameters: the - database schema name the column names Vector |
getColumnProperties | public Map getColumnProperties(String schema, String table, String column) throws DataSourceException(Code) | | Retrieves the column names for the specified
database table and schema as an array.
Parameters: the - database table name Parameters: the - database schema name the column name |
getDataSourceName | public String getDataSourceName()(Code) | | Retrieves the connected data source name.
the data source name |
getDataTypesArray | public String[] getDataTypesArray() throws DataSourceException(Code) | | Retrieves the database SQL data type names only.
the SQL data type names within an array |
getDataTypesResultSet | public ResultSet getDataTypesResultSet() throws DataSourceException(Code) | | Retrieves the database SQL data types as a
ResultSet object.
This will be typically used to display the
complete data types meta data retrieved from the JDBC driver.
the SQL data types |
getDatabaseKeywords | public String[] getDatabaseKeywords() throws DataSourceException(Code) | | Retrieves the connected databases SQL keyword
list via a call to the DatabaseMetaData
object's getSQLKeywords() method.
The retrieved keywords are stored within a
2-dimensional array for display with the relevant
header within a table.
the schema names array |
getDatabaseProductName | public String getDatabaseProductName() throws DataSourceException(Code) | | Retrieves the database product name from
the connection's meta data.
the database product name |
getDatabaseProductNameVersion | public String getDatabaseProductNameVersion() throws DataSourceException(Code) | | Retrieves the database product version from
the connection's meta data.
the database product version |
getDatabaseProductVersion | public String getDatabaseProductVersion() throws DataSourceException(Code) | | Retrieves the database product version from
the connection's meta data.
the database product version |
getDatabaseProperties | public Hashtable getDatabaseProperties() throws DataSourceException(Code) | | Retrieves key/value type pairs using the
Reflection API to call and retrieve
values from the connection's meta data object's methods
and variables.
The values are returned within a 2-dimensional
array of key/value pairs.
the database properties as key/value pairs |
getDatabaseTablesVector | public Vector getDatabaseTablesVector() throws DataSourceException(Code) | | Retrieves the currently connected schema's
database table names within a Vector .
the table names |
getHost | public String getHost()(Code) | | Retrieves the connected host name.
the host name |
getHostedCatalogsVector | public Vector<String> getHostedCatalogsVector() throws DataSourceException(Code) | | Retrieves the current connection's hosted
schema names. The names are stored within a
Vector object as single String objects.
the schema names within a Vector |
getHostedSchemasVector | public Vector<String> getHostedSchemasVector() throws DataSourceException(Code) | | Retrieves the current connection's hosted
schema names. The names are stored within a
Vector object as single String objects.
the schema names within a Vector |
getPort | public int getPort()(Code) | | Retrieves the connected port number.
the port number |
getProcedureTerm | public String getProcedureTerm() throws DataSourceException(Code) | | Returns the procedure term used in the current connected
database.
the procedure term |
getSchemaName | public String getSchemaName()(Code) | | Retrieves the connected schema name.
the schema name |
getTableData | public ResultSet getTableData(String schema, String table) throws DataSourceException(Code) | | Retrieves the data in its entirety from the specified table
using SELECT * FROM table_name .
Parameters: schema - - the schema name (may be null) Parameters: table - - the table name the table data |
getTableDataRowCount | public int getTableDataRowCount(String schema, String table) throws DataSourceException(Code) | | Retrieves the table data row count for the specified table.
Parameters: schema - - the schema name (may be null) Parameters: table - - the table name the data row count |
getTableIndexes | public Vector<ColumnIndex> getTableIndexes(String catalog, String schema, String table) throws DataSourceException(Code) | | Retrieves a Vector of ColumnIndexData
objects containing all relevant information on the table indexes
for the specified table.
Parameters: the - table's name a Vector of ColumnIndexData objects |
getTableMetaData | public ResultSet getTableMetaData(String catalog, String schema, String name) throws DataSourceException(Code) | | Returns the table column meta data as a result set.
Parameters: the - table name Parameters: the - schema name Parameters: the - table name |
getURL | public String getURL()(Code) | | Retrieves the connected JDBC URL.
the JDBC URL |
getUser | public String getUser()(Code) | | Retrieves the connected user.
the user name |
setDatabaseConnection | public void setDatabaseConnection(DatabaseConnection dc)(Code) | | Sets the database connection object to that specified.
|
|
|