| java.lang.Object org.netbeans.modules.sql.project.dbmodel.DBMetaData
DBMetaData | public class DBMetaData (Code) | | Extracts database metadata information (table names and constraints, their
associated columns, etc.)
author: Susan Chen version: |
Method Summary | |
public void | checkForeignKeys(Table newTable) Gets the foreign keys for a table. | public void | checkPrimaryKeys(Table newTable) Gets the primary keys for a table. | public void | connectDB(String driver, String url, String userName, String passWord) Establishes a connection to the database. | public void | disconnectDB() Disconnects from the database. | public String | getDBName() | public String | getDBType() Returns the database OTD type. | public boolean | getErrPrepStmtMetaData() | public boolean | getErrProcMetaData() | public String | getErrString() Get String representing current error message, if any. | public List | getForeignKeys(String tcatalog, String tschema, String tname) Returns a list of foreign keys for a table. | public String | getJavaFromSQLTypeDescription(String sqlType) Converts a JDBC SQL Type to a Java Type. | public PrepStmt | getPrepStmtMetaData(String catalog, String schema, String name, String sqlText) Gets the prepared statement metadata (parameters, resultsets). | public PrepStmt | getPrepStmtMetaData() | public List | getPrimaryKeys(String tcatalog, String tschema, String tname) Returns a list of primary keys for a table. | public void | getProcResultSetColumns(CallableStatement cstmt, Procedure proc) | public Procedure | getProcResultSetColumns(String pcatalog, String pschema, String pname, String columnName, Procedure procResult) | public Procedure | getProcedureMetaData() Gets the procedure metadata (parameters). | public Procedure | getProcedureMetaData(String pcatalog, String pschema, String pname, String ptype) Gets the procedure metadata (parameters). | public String | getProcedureText(Procedure proc) | public String[][] | getProcedures(String catalog, String schemaPattern, String procedurePattern) Returns a list of procedures matching in the passed in filters. | public Procedure | getQueryResultSet(String pcatalog, String pschema, String pname, String sqlText) | public String | getSQLText() | public static int | getSQLTypeCode(String sqlText) Converts a text representation of a JDBC SQL type to
a display string. | public static String | getSQLTypeDescription(int type) Converts the numeric value of a JDBC SQL type to
a display string. | public String[] | getSchemas() Returns a list of schemas in the database. | public Table | getTableMetaData(String tcatalog, String tschema, String tname, String ttype) Gets the table metadata (columns). | public String[][] | getTables(String catalog, String schemaPattern, String tablePattern, String[] tableTypes) Returns a list of tables/views matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: tablePattern - Table/View name pattern Parameters: tableTypes - List of table types to include (ex. | public String[][] | getTablesAndViews(String catalog, String schemaPattern, String tablePattern, boolean includeSystemTables) Returns a list of tables and views matching in the passed in filters. | public String[][] | getTablesOnly(String catalog, String schemaPattern, String tablePattern, boolean includeSystemTables) Returns a list of tables matching in the passed in filters. | public String[][] | getViewsOnly(String catalog, String schemaPattern, String viewPattern, boolean includeSystemTables) Returns a list of views matching in the passed in filters. | public static void | main(String args) |
CATALOG | final public static int CATALOG(Code) | | Index to the catalog field for results of table/view/procedure searches
|
DB2 | final public static String DB2(Code) | | Database OTD type for DB2
|
DB2_TEXT | final public static String DB2_TEXT(Code) | | Database type display description for DB2
|
DBTYPES | final public static String[] DBTYPES(Code) | | List of database type display descriptions
|
JAVATYPES | final public static String[] JAVATYPES(Code) | | List of Java types
|
JDBCODBC_TEXT | final public static String JDBCODBC_TEXT(Code) | | Database type display description for JDBC-ODBC
|
JDBC_ODBC | final public static String JDBC_ODBC(Code) | | Database OTD type for JDBC-ODBC
|
NAME | final public static int NAME(Code) | | Index to the name field for results of table/view/procedure searches
|
ORACLE | final public static String ORACLE(Code) | | Database OTD type for Oracle
|
ORACLE_TEXT | final public static String ORACLE_TEXT(Code) | | Database type display description for Oracle
|
SCHEMA | final public static int SCHEMA(Code) | | Index to the schema field for results of table/view/procedure searches
|
SQLSERVER | final public static String SQLSERVER(Code) | | Database OTD type for SQL Server
|
SQLSERVER_TEXT | final public static String SQLSERVER_TEXT(Code) | | Database type display description for SQL Server
|
SQLTOJAVATYPES | final public static HashMap SQLTOJAVATYPES(Code) | | Map SQL type to Java type
|
SQLTYPES | final public static String[] SQLTYPES(Code) | | List of JDBC SQL types
|
SQLTYPE_CODES | final public static int[] SQLTYPE_CODES(Code) | | |
SYBASE | final public static String SYBASE(Code) | | Database OTD type for Sybase
|
SYBASE_TEXT | final public static String SYBASE_TEXT(Code) | | Database type display description for Sybase
|
TYPE | final public static int TYPE(Code) | | Index to the type field for results of table/view/procedure searches
|
VSAM_ADABAS_IAM | final public static String VSAM_ADABAS_IAM(Code) | | Database OTD type for VSAM
|
VSAM_ADABAS_IAM_TEXT | final public static String VSAM_ADABAS_IAM_TEXT(Code) | | Database type display description for VSAM/ADABAS/IAM
|
DBMetaData | public DBMetaData()(Code) | | |
checkForeignKeys | public void checkForeignKeys(Table newTable) throws Exception(Code) | | Gets the foreign keys for a table.
Parameters: newTable - Table to get the foreign key(s) for throws: Exception - DOCUMENT ME! |
checkPrimaryKeys | public void checkPrimaryKeys(Table newTable) throws Exception(Code) | | Gets the primary keys for a table.
Parameters: newTable - Table to get the primary key(s) for throws: Exception - DOCUMENT ME! |
connectDB | public void connectDB(String driver, String url, String userName, String passWord) throws Exception(Code) | | Establishes a connection to the database.
Parameters: driver - Driver class Parameters: url - JDBC connection URL Parameters: userName - User name Parameters: passWord - Password throws: Exception - DOCUMENT ME! |
disconnectDB | public void disconnectDB() throws Exception(Code) | | Disconnects from the database.
throws: Exception - DOCUMENT ME! |
getDBName | public String getDBName() throws Exception(Code) | | Returns the database product name
String database product name throws: Exception - DOCUMENT ME! |
getErrPrepStmtMetaData | public boolean getErrPrepStmtMetaData()(Code) | | |
getErrProcMetaData | public boolean getErrProcMetaData()(Code) | | |
getErrString | public String getErrString()(Code) | | Get String representing current error message, if any.
error message |
getForeignKeys | public List getForeignKeys(String tcatalog, String tschema, String tname) throws Exception(Code) | | Returns a list of foreign keys for a table.
Parameters: tcatalog - Catalog name Parameters: tschema - Schema name Parameters: tname - Table name List List of foreign keys throws: Exception - DOCUMENT ME! |
getJavaFromSQLTypeDescription | public String getJavaFromSQLTypeDescription(String sqlType)(Code) | | Converts a JDBC SQL Type to a Java Type.
Parameters: sqlType - JDBC SQL Type Java Type |
getPrepStmtMetaData | public PrepStmt getPrepStmtMetaData(String catalog, String schema, String name, String sqlText) throws Exception(Code) | | Gets the prepared statement metadata (parameters, resultsets).
Parameters: catalog - Catalog name Parameters: schema - Schema name Parameters: name - Prepared statement name Parameters: sqlText - SQL text of prepared statement PrepStmt Prepared statement object throws: Exception - DOCUMENT ME! |
getPrimaryKeys | public List getPrimaryKeys(String tcatalog, String tschema, String tname) throws Exception(Code) | | Returns a list of primary keys for a table.
Parameters: tcatalog - Catalog name Parameters: tschema - Schema name Parameters: tname - Table name List List of primary keys throws: Exception - DOCUMENT ME! |
getProcedureMetaData | public Procedure getProcedureMetaData() throws Exception(Code) | | Gets the procedure metadata (parameters).
Parameters: pcatalog - Catalog name Parameters: pschema - Schema name Parameters: pname - Procedure name Parameters: ptype - Procedure type Procedure object throws: Exception - DOCUMENT ME! |
getProcedureMetaData | public Procedure getProcedureMetaData(String pcatalog, String pschema, String pname, String ptype) throws Exception(Code) | | Gets the procedure metadata (parameters).
Parameters: pcatalog - Catalog name Parameters: pschema - Schema name Parameters: pname - Procedure name Parameters: ptype - Procedure type Procedure object throws: Exception - DOCUMENT ME! |
getProcedureText | public String getProcedureText(Procedure proc)(Code) | | added by Bobby to retrieve the text of a procedure/function
Parameters: Procedure - Procedure object representing a procedure or function String Text of the procedure or function |
getProcedures | public String[][] getProcedures(String catalog, String schemaPattern, String procedurePattern) throws Exception(Code) | | Returns a list of procedures matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: procedurePattern - Procedure name pattern String[][] List of procedures matching search filters throws: Exception - DOCUMENT ME! |
getQueryResultSet | public Procedure getQueryResultSet(String pcatalog, String pschema, String pname, String sqlText) throws SQLException, NullPointerException(Code) | | added by Bobby to retrieve the resultset metadata of an SQL query
Parameters: pcatalog - Catalog (package) name of the procedure Parameters: pschema - Schema name of the procdure Parameters: pname - Name of the procedure Parameters: sqlText - Text of the procedure/function Procedure resultset encapsulated in a Procedure object throws: SQLException - , NullPointerException |
getSQLTypeCode | public static int getSQLTypeCode(String sqlText)(Code) | | Converts a text representation of a JDBC SQL type to
a display string.
Parameters: sqlText - JDBC SQL type string JDBC numeric SQL type value |
getSQLTypeDescription | public static String getSQLTypeDescription(int type)(Code) | | Converts the numeric value of a JDBC SQL type to
a display string.
Parameters: type - JDBC numeric SQL type value JDBC SQL type string |
getSchemas | public String[] getSchemas() throws Exception(Code) | | Returns a list of schemas in the database.
String[] List of schema names throws: Exception - DOCUMENT ME! |
getTableMetaData | public Table getTableMetaData(String tcatalog, String tschema, String tname, String ttype) throws Exception(Code) | | Gets the table metadata (columns).
Parameters: tcatalog - Catalog name Parameters: tschema - Schema name Parameters: tname - Table name Parameters: ttype - Table type Table object throws: Exception - DOCUMENT ME! |
getTables | public String[][] getTables(String catalog, String schemaPattern, String tablePattern, String[] tableTypes) throws Exception(Code) | | Returns a list of tables/views matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: tablePattern - Table/View name pattern Parameters: tableTypes - List of table types to include (ex. TABLE, VIEW) String[][] List of tables matching search filters throws: Exception - DOCUMENT ME! |
getTablesAndViews | public String[][] getTablesAndViews(String catalog, String schemaPattern, String tablePattern, boolean includeSystemTables) throws Exception(Code) | | Returns a list of tables and views matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: tablePattern - Table/View name pattern Parameters: includeSystemTables - Indicate whether to include system tables in search String[][] List of tables and views matching search filters throws: Exception - DOCUMENT ME! |
getTablesOnly | public String[][] getTablesOnly(String catalog, String schemaPattern, String tablePattern, boolean includeSystemTables) throws Exception(Code) | | Returns a list of tables matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: tablePattern - Table name pattern Parameters: includeSystemTables - Indicate whether to include system tables in search String[][] List of tables matching search filters throws: Exception - DOCUMENT ME! |
getViewsOnly | public String[][] getViewsOnly(String catalog, String schemaPattern, String viewPattern, boolean includeSystemTables) throws Exception(Code) | | Returns a list of views matching in the passed in filters.
Parameters: catalog - Catalog name Parameters: schemaPattern - Schema pattern Parameters: viewPattern - View name pattern Parameters: includeSystemTables - Indicate whether to include system tables in search String[][] List of views matching search filters throws: Exception - DOCUMENT ME! |
main | public static void main(String args)(Code) | | Main routine
Parameters: args - command line arguments |
|
|