Java Doc for DBMetaData.java in  » IDE-Netbeans » sql.project » org » netbeans » modules » sql » project » dbmodel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » sql.project » org.netbeans.modules.sql.project.dbmodel 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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:
  


Field Summary
final public static  intCATALOG
    
final public static  StringDB2
    
final public static  StringDB2_TEXT
    
final public static  String[]DBTYPES
    
final public static  String[]JAVATYPES
    
final public static  StringJDBCODBC_TEXT
    
final public static  StringJDBC_ODBC
    
final public static  intNAME
    
final public static  StringORACLE
    
final public static  StringORACLE_TEXT
    
final public static  intSCHEMA
    
final public static  StringSQLSERVER
    
final public static  StringSQLSERVER_TEXT
    
final public static  HashMapSQLTOJAVATYPES
    
final public static  String[]SQLTYPES
    
final public static  int[]SQLTYPE_CODES
    
final public static  StringSYBASE
    
final public static  StringSYBASE_TEXT
    
final public static  intTYPE
    
final public static  StringVSAM_ADABAS_IAM
    
final public static  StringVSAM_ADABAS_IAM_TEXT
    

Constructor Summary
public  DBMetaData(Connection conn, String sqlText)
    
public  DBMetaData()
    

Method Summary
public  voidcheckForeignKeys(Table newTable)
     Gets the foreign keys for a table.
public  voidcheckPrimaryKeys(Table newTable)
     Gets the primary keys for a table.
public  voidconnectDB(String driver, String url, String userName, String passWord)
     Establishes a connection to the database.
public  voiddisconnectDB()
     Disconnects from the database.
public  StringgetDBName()
    
public  StringgetDBType()
     Returns the database OTD type.
public  booleangetErrPrepStmtMetaData()
    
public  booleangetErrProcMetaData()
    
public  StringgetErrString()
     Get String representing current error message, if any.
public  ListgetForeignKeys(String tcatalog, String tschema, String tname)
     Returns a list of foreign keys for a table.
public  StringgetJavaFromSQLTypeDescription(String sqlType)
     Converts a JDBC SQL Type to a Java Type.
public  PrepStmtgetPrepStmtMetaData(String catalog, String schema, String name, String sqlText)
     Gets the prepared statement metadata (parameters, resultsets).
public  PrepStmtgetPrepStmtMetaData()
    
public  ListgetPrimaryKeys(String tcatalog, String tschema, String tname)
     Returns a list of primary keys for a table.
public  voidgetProcResultSetColumns(CallableStatement cstmt, Procedure proc)
    
public  ProceduregetProcResultSetColumns(String pcatalog, String pschema, String pname, String columnName, Procedure procResult)
    
public  ProceduregetProcedureMetaData()
     Gets the procedure metadata (parameters).
public  ProceduregetProcedureMetaData(String pcatalog, String pschema, String pname, String ptype)
     Gets the procedure metadata (parameters).
public  StringgetProcedureText(Procedure proc)
    
public  String[][]getProcedures(String catalog, String schemaPattern, String procedurePattern)
     Returns a list of procedures matching in the passed in filters.
public  ProceduregetQueryResultSet(String pcatalog, String pschema, String pname, String sqlText)
    
public  StringgetSQLText()
    
public static  intgetSQLTypeCode(String sqlText)
     Converts a text representation of a JDBC SQL type to a display string.
public static  StringgetSQLTypeDescription(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  TablegetTableMetaData(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  voidmain(String args)
    

Field Detail
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




Constructor Detail
DBMetaData
public DBMetaData(Connection conn, String sqlText)(Code)



DBMetaData
public DBMetaData()(Code)




Method Detail
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!



getDBType
public String getDBType() throws Exception(Code)
Returns the database OTD type. String Database OTD type
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!



getPrepStmtMetaData
public PrepStmt getPrepStmtMetaData() throws Exception(Code)



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!



getProcResultSetColumns
public void getProcResultSetColumns(CallableStatement cstmt, Procedure proc) throws SQLException, NullPointerException(Code)



getProcResultSetColumns
public Procedure getProcResultSetColumns(String pcatalog, String pschema, String pname, String columnName, Procedure procResult) throws SQLException, NullPointerException(Code)



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



getSQLText
public String getSQLText()(Code)



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.