Java Doc for DbMetadata.java in  » Database-Client » SQL-Workbench » workbench » db » 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 » Database Client » SQL Workbench » workbench.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   workbench.db.DbMetadata

DbMetadata
public class DbMetadata (Code)
Retrieve meta data information from the database. This class returns more information than the generic JDBC DatabaseMetadata.
author:
   support@sql-workbench.net


Field Summary
final public static  intCOLUMN_IDX_FK_DEF_COLUMN_NAME
    
final public static  intCOLUMN_IDX_FK_DEF_DEFERRABLE
    
final public static  intCOLUMN_IDX_FK_DEF_DEFERRABLE_RULE_VALUE
    
final public static  intCOLUMN_IDX_FK_DEF_DELETE_RULE
    
final public static  intCOLUMN_IDX_FK_DEF_DELETE_RULE_VALUE
    
final public static  intCOLUMN_IDX_FK_DEF_FK_NAME
    
final public static  intCOLUMN_IDX_FK_DEF_REFERENCE_COLUMN_NAME
    
final public static  intCOLUMN_IDX_FK_DEF_UPDATE_RULE
    
final public static  intCOLUMN_IDX_FK_DEF_UPDATE_RULE_VALUE
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_COL_NAME
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_DATA_TYPE
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_DEFAULT
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_DIGITS
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_JAVA_SQL_TYPE
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_NULLABLE
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_PK_FLAG
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_POSITION
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_REMARKS
    
final public static  intCOLUMN_IDX_TABLE_DEFINITION_SIZE
    
final public static  intCOLUMN_IDX_TABLE_INDEXLIST_COL_DEF
    
final public static  intCOLUMN_IDX_TABLE_INDEXLIST_INDEX_NAME
    
final public static  intCOLUMN_IDX_TABLE_INDEXLIST_PK_FLAG
    
final public static  intCOLUMN_IDX_TABLE_INDEXLIST_TYPE
    
final public static  intCOLUMN_IDX_TABLE_INDEXLIST_UNIQUE_FLAG
    
final public static  intCOLUMN_IDX_TABLE_LIST_CATALOG
    
final public static  intCOLUMN_IDX_TABLE_LIST_NAME
    
final public static  intCOLUMN_IDX_TABLE_LIST_REMARKS
    
final public static  intCOLUMN_IDX_TABLE_LIST_SCHEMA
    
final public static  intCOLUMN_IDX_TABLE_LIST_TYPE
     The column index of the column in the DataStore returned by getTables() that stores the table's type.
final public static  intCOLUMN_IDX_TABLE_TRIGGERLIST_TRG_EVENT
     The column index in the DataStore returned by getTableTriggers which identifies the event (before, after) of the trigger.
final public static  intCOLUMN_IDX_TABLE_TRIGGERLIST_TRG_NAME
     The column index in the DataStore returned by getTableTriggers which identifies the name of the trigger.
final public static  intCOLUMN_IDX_TABLE_TRIGGERLIST_TRG_TYPE
     The column index in the DataStore returned by getTableTriggers which identifies the type (INSERT, UPDATE etc) of the trigger.
final public static  StringMVIEW_NAME
    
final public static  String[]TABLE_DEFINITION_COLS
    
protected  MetaDataSqlManagermetaSqlMgr
    

Constructor Summary
public  DbMetadata(WbConnection aConnection)
    

Method Summary
public  StringadjustObjectnameCase(String name)
     Adjusts the case of the given object to the case in which the server stores objects This is needed e.g.
public  StringadjustSchemaNameCase(String schema)
     Adjusts the case of the given schema name to the case in which the server stores schema names. This is needed e.g.
public  StringbuildIndexSource(TableIdentifier aTable, String indexName, boolean unique, String[] columnList)
     Build the SQL statement to create an Index on the given table.
public  voidclose()
     Release any resources for this object.
public  voiddisableOutput()
    
public  voidenableOutput()
    
public  voidenableOutput(long aLimit)
     Enable Oracle's DBMS_OUTPUT package.
public  StringfilterDDL(String sql)
     If a DDLFilter is registered for the current DBMS, this method will replace all "problematic" characters in the SQL string, and will return a String that the DBMS will understand.
public  TableIdentifierfindTable(TableIdentifier tbl)
    
public  intfixColumnType(int type)
    
public  DataStoregetCatalogInformation()
     Returns a list of all catalogs in the database.
public  StringgetCatalogTerm()
    
public  Map<String, String>getColumnConstraints(TableIdentifier table)
     Return constraints defined for each column in the given table.
Parameters:
  table - The table to check A Map with columns and their constraints.
public  StringgetCurrentCatalog()
     Return the current catalog for this connection.
public  StringgetCurrentSchema()
     Returns the current schema.
public  Set<String>getDbDataTypes()
    
public  Set<String>getDbFunctions()
    
public  StringgetDbId()
    
public  DbSettingsgetDbSettings()
    
public  DataStoregetExportedKeys(TableIdentifier tbl)
    
public  StringgetExtendedErrorInfo(String schema, String objectName, String objectType)
     Returns the errors available for the given object and type.
public  CharSequencegetExtendedViewSource(TableIdentifier tbl, boolean includeDrop)
    
public  CharSequencegetExtendedViewSource(TableIdentifier view, DataStore viewTableDefinition, boolean includeDrop)
     Returns a complete SQL statement to (re)create the given view.
public  StringBuildergetFkSource(TableIdentifier table)
    
public  StringBuildergetFkSource(TableIdentifier table, DataStore aFkDef, String tableNameToUse, boolean forInlineUse)
     Return a SQL script to re-create the Foreign key definition for the given table.
public  DataStoregetForeignKeys(TableIdentifier table, boolean includeNumericRuleValue)
    
public  DataStoregetImportedKeys(TableIdentifier tbl)
    
public  DatabaseMetaDatagetJdbcMetadata()
    
protected  StringgetMViewSource(TableIdentifier table, List<ColumnIdentifier> columns, DataStore aIndexDef, boolean includeDrop)
    
public  StringgetMViewTypeName()
    
public  StringgetObjectType(TableIdentifier table)
     Returns the type of the passed TableIdentifier.
public  StringgetOutputMessages()
     Return any server side messages.
public  CharSequencegetPkSource(TableIdentifier table, List pkCols, String pkName)
     Builds an ALTER TABLE to add a primary key definition for the given tablename.
public  DataStoregetProcedureColumns(String aCatalog, String aSchema, String aProcname)
     Returns the columns (==parameters) defined for the given procedure.
public  List<ProcedureDefinition>getProcedureList(String aCatalog, String aSchema)
     Return a List of workbench.db.ProcedureDefinition objects for Oracle packages only one ProcedureDefinition per package is returned (although the DbExplorer will list each function of the packages).
public  CharSequencegetProcedureSource(String aCatalog, String aSchema, String aProcname, int type)
    
public  DataStoregetProcedures(String aCatalog, String aSchema)
     Return a list of stored procedures that are available in the database.
public  DataStoregetProceduresAndTriggers(String aCatalog, String aSchema)
     Return a list of stored procedures that are available in the database.
public  StringgetProductName()
    
public  DataStoregetReferencedBy(TableIdentifier table)
    
public  StringgetSchemaTerm()
    
public  StringgetSchemaToUse()
     Returns the schema that should be used for the current user This essential call DbMetadata.getCurrentSchema() .
public  List<String>getSchemas()
    
public  List<TableIdentifier>getSelectableObjectsList(String schema)
    
public  SequenceReadergetSequenceReader()
    
public  CharSequencegetSequenceSource(String fullName)
    
public  CharSequencegetSequenceSource(String aCatalog, String aSchema, String aSequence)
    
public  ConnectiongetSqlConnection()
    
public  Collection<String>getSqlKeywords()
    
public  StringgetSynonymSource(TableIdentifier synonym)
     Return the SQL statement to recreate the given synonym.
public  TableIdentifiergetSynonymTable(TableIdentifier synonym)
     Return the underlying table of a synonym.
protected  TableIdentifiergetSynonymTable(String schema, String synonym)
     Return the underlying table of a synonym.
public  StringBuildergetTableColumnCommentsSql(TableIdentifier table, List<ColumnIdentifier> columns)
     Return the SQL that is needed to re-create the comment on the given columns.
public  List<ColumnIdentifier>getTableColumns(TableIdentifier table)
     Return the column list for the given table.
public  StringgetTableComment(TableIdentifier tbl)
    
public  StringgetTableCommentSql(TableIdentifier table)
     Return the SQL that is needed to re-create the comment on the given table.
public  StringgetTableConstraints(TableIdentifier tbl, String indent)
     Return the SQL source for check constraints defined for the table.
public  DataStoregetTableDefinition(TableIdentifier id)
    
protected  DataStoregetTableDefinition(String aCatalog, String aSchema, String aTable, String aType)
     Return a DataStore containing the definition of the given table.
Parameters:
  aCatalog - The catalog in which the table is defined.
public  StringBuildergetTableGrantSource(TableIdentifier table)
     Creates an SQL Statement which can be used to re-create the GRANTs on the given table.
public  Collection<TableGrant>getTableGrants(TableIdentifier table)
     Return the GRANTs for the given table Some JDBC drivers return all GRANT privileges separately even if the original GRANT was a GRANT ALL ON object TO user.
public  DataStoregetTableIndexInformation(TableIdentifier table)
     Return the index information for a table as a DataStore.
public  Collection<IndexDefinition>getTableIndexList(TableIdentifier table)
    
public  List<TableIdentifier>getTableList(String schema, String[] types)
    
public  List<TableIdentifier>getTableList(String table, String schema)
    
public  List<TableIdentifier>getTableList(String table, String schema, String[] types)
    
public  List<TableIdentifier>getTableList(String table, String schema, String[] types, boolean returnAllSchemas)
    
public  StringgetTableSource(TableIdentifier table, boolean includeDrop, boolean includeFk)
     Return the SQL statement to re-create the given table.
public  StringgetTableSource(TableIdentifier table, List<ColumnIdentifier> columns, String tableNameToUse)
    
public  StringgetTableSource(TableIdentifier table, DataStore columns, DataStore aIndexDef, DataStore aFkDef, boolean includeDrop, String tableNameToUse)
    
public  StringgetTableSource(TableIdentifier table, List<ColumnIdentifier> columns, DataStore aIndexDef, DataStore aFkDef, boolean includeDrop, String tableNameToUse, boolean includeFk)
    
public  DataStoregetTableTriggers(TableIdentifier table)
     Return the list of defined triggers for the given table.
public  StringgetTableType(TableIdentifier table)
    
public  StringgetTableTypeName()
    
public  Collection<String>getTableTypes()
    
public  DataStoregetTables()
    
public  DataStoregetTables(String aCatalog, String aSchema, String[] types)
    
public  DataStoregetTables(String aCatalog, String aSchema, String tables, String[] types)
    
public  StringgetTriggerSource(String aCatalog, String aSchema, String aTriggername)
     Retrieve the SQL Source of the given trigger.
Parameters:
  aCatalog - The catalog in which the trigger is defined.
public  DataStoregetTriggers(String catalog, String schema)
     Return a list of triggers available in the given schema.
protected  DataStoregetTriggers(String catalog, String schema, String tableName)
    
public  CharSequencegetViewSource(TableIdentifier viewId)
     Return the source of a view definition as it is stored in the database.
public  StringgetViewTypeName()
    
public  WbConnectiongetWbConnection()
    
public  booleanignoreCatalog(String catalog)
    
public  booleanignoreSchema(String schema)
    
public  booleanisApacheDerby()
    
public  booleanisCaseSensitive()
    
public  booleanisDefaultCase(String name)
    
public  booleanisFirebird()
    
public  booleanisHsql()
    
public  booleanisKeyword(String name)
    
public  booleanisMySql()
    
public  booleanisOracle()
    
public  booleanisPostgres()
    
public  booleanisSelectIntoNewTable(String sql)
     Checks if the given SQL string is actually some kind of table creation "disguised" as a SELECT.
public  booleanisSqlServer()
    
public  booleanisTableType(String type)
    
public  booleanneedCatalogInDML(TableIdentifier table)
    
public  booleanneedSchemaInDML(TableIdentifier table)
     Check if the given TableIdentifier requires the usage of the schema for a DML (select, insert, update, delete) statement.
public  booleanobjectExists(TableIdentifier aTable, String type)
    
public  booleanobjectExists(TableIdentifier aTable, String[] types)
    
public  booleanobjectTypeCanContainData(String type)
     Check if the given DB object type can contain data.
public  booleanprocedureExists(ProcedureDefinition def)
    
public  StringquoteObjectname(String aName)
    
public  StringquoteObjectname(String aName, boolean quoteAlways)
     Encloses the given object name in double quotes if necessary. Quoting of names is necessary if the name is a reserved word in the database.
public  voidreadProcedureSource(ProcedureDefinition def)
    
public  TableIdentifierresolveSynonym(TableIdentifier tbl)
     If the passed TableIdentifier is a Synonym and the current DBMS supports synonyms, a TableIdentifier for the "real" table is returned.
public  booleansetCurrentCatalog(String newCatalog)
     Changes the current catalog using Connection.setCatalog() and notifies the connection object about the change.
public  booleanstoresLowerCaseIdentifiers()
     Returns true if the server stores identifiers in lower case. Usually this is delegated to the JDBC driver, but as some drivers (e.g.
public  booleanstoresLowerCaseSchemas()
    
public  booleanstoresMixedCaseIdentifiers()
     Returns true if the server stores identifiers in mixed case. Usually this is delegated to the JDBC driver, but as some drivers (e.g.
public  booleanstoresUpperCaseIdentifiers()
     Returns true if the server stores identifiers in upper case. Usually this is delegated to the JDBC driver, but as some drivers (e.g.
public  booleanstoresUpperCaseSchemas()
    
public  booleansupportsBatchUpdates()
     Wrapper for DatabaseMetaData.supportsBatchUpdates() that throws no exception.
public  booleansupportsCatalogs()
    
protected  booleansupportsMixedCaseIdentifiers()
    
protected  booleansupportsMixedCaseQuotedIdentifiers()
    
public  booleansupportsSelectIntoNewTable()
     Returns true if the current DBMS supports a SELECT syntax which creates a new table (e.g.
public  booleansupportsSynonyms()
     Checks if the current DBMS supports synonyms.
public  booleantableExists(TableIdentifier aTable)
    

Field Detail
COLUMN_IDX_FK_DEF_COLUMN_NAME
final public static int COLUMN_IDX_FK_DEF_COLUMN_NAME(Code)



COLUMN_IDX_FK_DEF_DEFERRABLE
final public static int COLUMN_IDX_FK_DEF_DEFERRABLE(Code)



COLUMN_IDX_FK_DEF_DEFERRABLE_RULE_VALUE
final public static int COLUMN_IDX_FK_DEF_DEFERRABLE_RULE_VALUE(Code)



COLUMN_IDX_FK_DEF_DELETE_RULE
final public static int COLUMN_IDX_FK_DEF_DELETE_RULE(Code)



COLUMN_IDX_FK_DEF_DELETE_RULE_VALUE
final public static int COLUMN_IDX_FK_DEF_DELETE_RULE_VALUE(Code)



COLUMN_IDX_FK_DEF_FK_NAME
final public static int COLUMN_IDX_FK_DEF_FK_NAME(Code)



COLUMN_IDX_FK_DEF_REFERENCE_COLUMN_NAME
final public static int COLUMN_IDX_FK_DEF_REFERENCE_COLUMN_NAME(Code)



COLUMN_IDX_FK_DEF_UPDATE_RULE
final public static int COLUMN_IDX_FK_DEF_UPDATE_RULE(Code)



COLUMN_IDX_FK_DEF_UPDATE_RULE_VALUE
final public static int COLUMN_IDX_FK_DEF_UPDATE_RULE_VALUE(Code)



COLUMN_IDX_TABLE_DEFINITION_COL_NAME
final public static int COLUMN_IDX_TABLE_DEFINITION_COL_NAME(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the column name



COLUMN_IDX_TABLE_DEFINITION_DATA_TYPE
final public static int COLUMN_IDX_TABLE_DEFINITION_DATA_TYPE(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the DBMS specific data type string



COLUMN_IDX_TABLE_DEFINITION_DEFAULT
final public static int COLUMN_IDX_TABLE_DEFINITION_DEFAULT(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the default value for this column



COLUMN_IDX_TABLE_DEFINITION_DIGITS
final public static int COLUMN_IDX_TABLE_DEFINITION_DIGITS(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the number of digits for the column



COLUMN_IDX_TABLE_DEFINITION_JAVA_SQL_TYPE
final public static int COLUMN_IDX_TABLE_DEFINITION_JAVA_SQL_TYPE(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the integer value of the java datatype from java.sql.Types



COLUMN_IDX_TABLE_DEFINITION_NULLABLE
final public static int COLUMN_IDX_TABLE_DEFINITION_NULLABLE(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the nullable flag



COLUMN_IDX_TABLE_DEFINITION_PK_FLAG
final public static int COLUMN_IDX_TABLE_DEFINITION_PK_FLAG(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the primary key flag



COLUMN_IDX_TABLE_DEFINITION_POSITION
final public static int COLUMN_IDX_TABLE_DEFINITION_POSITION(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the ordinal position of the column



COLUMN_IDX_TABLE_DEFINITION_REMARKS
final public static int COLUMN_IDX_TABLE_DEFINITION_REMARKS(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the remark for this column



COLUMN_IDX_TABLE_DEFINITION_SIZE
final public static int COLUMN_IDX_TABLE_DEFINITION_SIZE(Code)
The column index for a workbench.storage.DataStore returned by DbMetadata.getTableDefinition(TableIdentifier) that holds the integer value of siez of the column



COLUMN_IDX_TABLE_INDEXLIST_COL_DEF
final public static int COLUMN_IDX_TABLE_INDEXLIST_COL_DEF(Code)



COLUMN_IDX_TABLE_INDEXLIST_INDEX_NAME
final public static int COLUMN_IDX_TABLE_INDEXLIST_INDEX_NAME(Code)



COLUMN_IDX_TABLE_INDEXLIST_PK_FLAG
final public static int COLUMN_IDX_TABLE_INDEXLIST_PK_FLAG(Code)



COLUMN_IDX_TABLE_INDEXLIST_TYPE
final public static int COLUMN_IDX_TABLE_INDEXLIST_TYPE(Code)



COLUMN_IDX_TABLE_INDEXLIST_UNIQUE_FLAG
final public static int COLUMN_IDX_TABLE_INDEXLIST_UNIQUE_FLAG(Code)



COLUMN_IDX_TABLE_LIST_CATALOG
final public static int COLUMN_IDX_TABLE_LIST_CATALOG(Code)
The column index of the column in the DataStore returned by getTables() the stores the table's catalog



COLUMN_IDX_TABLE_LIST_NAME
final public static int COLUMN_IDX_TABLE_LIST_NAME(Code)
The column index of the column in the DataStore returned by getTables() the stores the table's name



COLUMN_IDX_TABLE_LIST_REMARKS
final public static int COLUMN_IDX_TABLE_LIST_REMARKS(Code)
The column index of the column in the DataStore returned by getTables() the stores the table's comment



COLUMN_IDX_TABLE_LIST_SCHEMA
final public static int COLUMN_IDX_TABLE_LIST_SCHEMA(Code)
The column index of the column in the DataStore returned by getTables() the stores the table's schema



COLUMN_IDX_TABLE_LIST_TYPE
final public static int COLUMN_IDX_TABLE_LIST_TYPE(Code)
The column index of the column in the DataStore returned by getTables() that stores the table's type. The available types can be retrieved using DbMetadata.getTableTypes()



COLUMN_IDX_TABLE_TRIGGERLIST_TRG_EVENT
final public static int COLUMN_IDX_TABLE_TRIGGERLIST_TRG_EVENT(Code)
The column index in the DataStore returned by getTableTriggers which identifies the event (before, after) of the trigger.



COLUMN_IDX_TABLE_TRIGGERLIST_TRG_NAME
final public static int COLUMN_IDX_TABLE_TRIGGERLIST_TRG_NAME(Code)
The column index in the DataStore returned by getTableTriggers which identifies the name of the trigger.



COLUMN_IDX_TABLE_TRIGGERLIST_TRG_TYPE
final public static int COLUMN_IDX_TABLE_TRIGGERLIST_TRG_TYPE(Code)
The column index in the DataStore returned by getTableTriggers which identifies the type (INSERT, UPDATE etc) of the trigger.



MVIEW_NAME
final public static String MVIEW_NAME(Code)



TABLE_DEFINITION_COLS
final public static String[] TABLE_DEFINITION_COLS(Code)



metaSqlMgr
protected MetaDataSqlManager metaSqlMgr(Code)




Constructor Detail
DbMetadata
public DbMetadata(WbConnection aConnection) throws SQLException(Code)




Method Detail
adjustObjectnameCase
public String adjustObjectnameCase(String name)(Code)
Adjusts the case of the given object to the case in which the server stores objects This is needed e.g. when the user types a table name, and that value is used to retrieve the table definition. Usually the getColumns() method is case sensitiv.
Parameters:
  name - the object name to adjust the adjusted object name



adjustSchemaNameCase
public String adjustSchemaNameCase(String schema)(Code)
Adjusts the case of the given schema name to the case in which the server stores schema names. This is needed e.g. when the user types a table name, and that value is used to retrieve the table definition.
Parameters:
  schema - the schema name to adjust the adjusted schema name



buildIndexSource
public String buildIndexSource(TableIdentifier aTable, String indexName, boolean unique, String[] columnList)(Code)
Build the SQL statement to create an Index on the given table.
Parameters:
  aTable - - The table name for which the index should be constructed
Parameters:
  indexName - - The name of the Index
Parameters:
  unique - - Should the index be unique
Parameters:
  columnList - - The columns that should build the index



close
public void close()(Code)
Release any resources for this object. After a call to close(), this object should not be used any longer



disableOutput
public void disableOutput()(Code)
Disable Oracle's DBMS_OUTPUT package
See Also:   workbench.db.oracle.DbmsOutput.disable



enableOutput
public void enableOutput()(Code)
Enable Oracle's DBMS_OUTPUT package with a default buffer size
See Also:   DbMetadata.enableOutput(long)



enableOutput
public void enableOutput(long aLimit)(Code)
Enable Oracle's DBMS_OUTPUT package.
See Also:   workbench.db.oracle.DbmsOutput.enable(long)



filterDDL
public String filterDDL(String sql)(Code)
If a DDLFilter is registered for the current DBMS, this method will replace all "problematic" characters in the SQL string, and will return a String that the DBMS will understand. Currently this is only implemented for PostgreSQL to mimic pgsql's $$ quoting for stored procedures
See Also:   workbench.db.postgres.PostgresDDLFilter



findTable
public TableIdentifier findTable(TableIdentifier tbl)(Code)



fixColumnType
public int fixColumnType(int type)(Code)



getCatalogInformation
public DataStore getCatalogInformation()(Code)
Returns a list of all catalogs in the database. Some DBMS's do not support catalogs, in this case the method will return an empty Datastore.



getCatalogTerm
public String getCatalogTerm()(Code)



getColumnConstraints
public Map<String, String> getColumnConstraints(TableIdentifier table)(Code)
Return constraints defined for each column in the given table.
Parameters:
  table - The table to check A Map with columns and their constraints. The keys to the Map are column namesThe value is the SQL source for the column. The actual retrieval is delegated to a ConstraintReader
See Also:   ConstraintReader.getColumnConstraints(java.sql.ConnectionTableIdentifier)



getCurrentCatalog
public String getCurrentCatalog()(Code)
Return the current catalog for this connection. If no catalog is defined or the DBMS does not support catalogs, an empty string is returned. This method works around a bug in Microsoft's JDBC driver which does not return the correct database (=catalog) after the database has been changed with the USE command from within the Workbench. If no query has been configured for the current DBMS, DatabaseMetaData.getCatalog() is used, otherwise the query that is configured with the property workbench.db.[dbid].currentcatalog.query
See Also:   DbSettings.getQueryForCurrentCatalog The name of the current catalog or an empty String if there is no current catalog



getCurrentSchema
public String getCurrentSchema()(Code)
Returns the current schema.



getDbDataTypes
public Set<String> getDbDataTypes()(Code)



getDbFunctions
public Set<String> getDbFunctions()(Code)



getDbId
public String getDbId()(Code)
Return a clean version of the productname that can be used as the part of a properties key
See Also:   DbMetadata.getProductName()



getDbSettings
public DbSettings getDbSettings()(Code)



getExportedKeys
public DataStore getExportedKeys(TableIdentifier tbl) throws SQLException(Code)



getExtendedErrorInfo
public String getExtendedErrorInfo(String schema, String objectName, String objectType)(Code)
Returns the errors available for the given object and type. This call is delegated to the available ErrorInformationReader extended error information if the current DBMS is Oracle. An empty string otherwise.
See Also:   ErrorInformationReader



getExtendedViewSource
public CharSequence getExtendedViewSource(TableIdentifier tbl, boolean includeDrop) throws SQLException(Code)



getExtendedViewSource
public CharSequence getExtendedViewSource(TableIdentifier view, DataStore viewTableDefinition, boolean includeDrop) throws SQLException(Code)
Returns a complete SQL statement to (re)create the given view.



getFkSource
public StringBuilder getFkSource(TableIdentifier table)(Code)



getFkSource
public StringBuilder getFkSource(TableIdentifier table, DataStore aFkDef, String tableNameToUse, boolean forInlineUse)(Code)
Return a SQL script to re-create the Foreign key definition for the given table.
Parameters:
  aTable - the tablename for which the foreign keys should be created
Parameters:
  aFkDef - a DataStore with the FK definition as returned by #getForeignKeys() a SQL statement to add the foreign key definitions to the given table



getForeignKeys
public DataStore getForeignKeys(TableIdentifier table, boolean includeNumericRuleValue)(Code)



getImportedKeys
public DataStore getImportedKeys(TableIdentifier tbl) throws SQLException(Code)



getJdbcMetadata
public DatabaseMetaData getJdbcMetadata()(Code)



getMViewSource
protected String getMViewSource(TableIdentifier table, List<ColumnIdentifier> columns, DataStore aIndexDef, boolean includeDrop)(Code)



getMViewTypeName
public String getMViewTypeName()(Code)



getObjectType
public String getObjectType(TableIdentifier table)(Code)
Returns the type of the passed TableIdentifier. This could be VIEW, TABLE, SYNONYM, ... If the JDBC driver does not return the object through the getTables() method, null is returned, otherwise the value reported in TABLE_TYPE If there is more than object with the same name but different types (is there a DB that supports that???) than the first object found will be returned.
See Also:   DbMetadata.getTables(String,String,String,String[])



getOutputMessages
public String getOutputMessages()(Code)
Return any server side messages. Currently this is only implemented for Oracle (and is returning messages that were "printed" using the DBMS_OUTPUT package



getPkSource
public CharSequence getPkSource(TableIdentifier table, List pkCols, String pkName)(Code)
Builds an ALTER TABLE to add a primary key definition for the given tablename.
Parameters:
  table -
Parameters:
  pkCols -
Parameters:
  pkName -



getProcedureColumns
public DataStore getProcedureColumns(String aCatalog, String aSchema, String aProcname) throws SQLException(Code)
Returns the columns (==parameters) defined for the given procedure.



getProcedureList
public List<ProcedureDefinition> getProcedureList(String aCatalog, String aSchema) throws SQLException(Code)
Return a List of workbench.db.ProcedureDefinition objects for Oracle packages only one ProcedureDefinition per package is returned (although the DbExplorer will list each function of the packages).



getProcedureSource
public CharSequence getProcedureSource(String aCatalog, String aSchema, String aProcname, int type)(Code)



getProcedures
public DataStore getProcedures(String aCatalog, String aSchema) throws SQLException(Code)
Return a list of stored procedures that are available in the database. This call is delegated to the currently defined workbench.db.ProcedureReader If no DBMS specific reader is used, this is the workbench.db.JdbcProcedureReader a DataStore with the list of procedures.



getProceduresAndTriggers
public DataStore getProceduresAndTriggers(String aCatalog, String aSchema) throws SQLException(Code)
Return a list of stored procedures that are available in the database. This call is delegated to the currently defined workbench.db.ProcedureReader If no DBMS specific reader is used, this is the workbench.db.JdbcProcedureReader a DataStore with the list of procedures.



getProductName
public String getProductName()(Code)
Return the name of the DBMS as reported by the JDBC driver



getReferencedBy
public DataStore getReferencedBy(TableIdentifier table)(Code)



getSchemaTerm
public String getSchemaTerm()(Code)



getSchemaToUse
public String getSchemaToUse()(Code)
Returns the schema that should be used for the current user This essential call DbMetadata.getCurrentSchema() . The method then checks if the schema should be ignored for the current dbms by calling DbMetadata.ignoreSchema(String) . If the Schema should not be ignored, the it's returned, otherwise the method will return null



getSchemas
public List<String> getSchemas()(Code)
Returns the list of schemas as returned by DatabaseMetadata.getSchemas() List



getSelectableObjectsList
public List<TableIdentifier> getSelectableObjectsList(String schema) throws SQLException(Code)



getSequenceReader
public SequenceReader getSequenceReader()(Code)



getSequenceSource
public CharSequence getSequenceSource(String fullName)(Code)



getSequenceSource
public CharSequence getSequenceSource(String aCatalog, String aSchema, String aSequence)(Code)



getSqlConnection
public Connection getSqlConnection()(Code)



getSqlKeywords
public Collection<String> getSqlKeywords()(Code)



getSynonymSource
public String getSynonymSource(TableIdentifier synonym)(Code)
Return the SQL statement to recreate the given synonym. the SQL to create the synonym.



getSynonymTable
public TableIdentifier getSynonymTable(TableIdentifier synonym)(Code)
Return the underlying table of a synonym.
Parameters:
  synonym - the synonym definition the table to which the synonym points or null if the passedname does not reference a synonym or if the DBMS does not support synonyms
See Also:   DbMetadata.getSynonymTable(String,String)



getSynonymTable
protected TableIdentifier getSynonymTable(String schema, String synonym)(Code)
Return the underlying table of a synonym.
Parameters:
  schema - the schema of the synonym
Parameters:
  synonym - the name of the synonym the table to which the synonym points or null if the passedname does not reference a synonym or if the DBMS does not support synonyms
See Also:   DbMetadata.getSynonymTable(String,String)



getTableColumnCommentsSql
public StringBuilder getTableColumnCommentsSql(TableIdentifier table, List<ColumnIdentifier> columns)(Code)
Return the SQL that is needed to re-create the comment on the given columns. The syntax to be used, can be configured in the ColumnCommentStatements.xml file.



getTableColumns
public List<ColumnIdentifier> getTableColumns(TableIdentifier table) throws SQLException(Code)
Return the column list for the given table.
Parameters:
  table - the table for which to retrieve the column definition
See Also:   DbMetadata.getTableDefinition(String,String,String,String)



getTableComment
public String getTableComment(TableIdentifier tbl)(Code)



getTableCommentSql
public String getTableCommentSql(TableIdentifier table)(Code)
Return the SQL that is needed to re-create the comment on the given table. The syntax to be used, can be configured in the TableCommentStatements.xml file.



getTableConstraints
public String getTableConstraints(TableIdentifier tbl, String indent)(Code)
Return the SQL source for check constraints defined for the table. This is delegated to a ConstraintReader A String with the table constraints. If no constrains exist, a null String is returned
Parameters:
  tbl - The table to check
Parameters:
  indent - A String defining the indention for the source code



getTableDefinition
public DataStore getTableDefinition(TableIdentifier id) throws SQLException(Code)
Returns the definition of the given table in a workbench.storage.DataStore definiton of the datastore
Parameters:
  id - The identifier of the table
throws:
  SQLException - If the table was not found or an error occurred
See Also:   DbMetadata.getTableDefinition(String,String,String,String)



getTableDefinition
protected DataStore getTableDefinition(String aCatalog, String aSchema, String aTable, String aType) throws SQLException(Code)
Return a DataStore containing the definition of the given table.
Parameters:
  aCatalog - The catalog in which the table is defined. This should be null if the DBMS does not support catalogs
Parameters:
  aSchema - The schema in which the table is defined. This should be null if the DBMS does not support schemas
Parameters:
  aTable - The name of the table
Parameters:
  aType - The type of the table
throws:
  SQLException - A DataStore with the table definition.The individual columns should be accessed using theCOLUMN_IDX_TABLE_DEFINITION_xxx constants.



getTableGrantSource
public StringBuilder getTableGrantSource(TableIdentifier table)(Code)
Creates an SQL Statement which can be used to re-create the GRANTs on the given table. SQL script to GRANT access to the table.



getTableGrants
public Collection<TableGrant> getTableGrants(TableIdentifier table)(Code)
Return the GRANTs for the given table Some JDBC drivers return all GRANT privileges separately even if the original GRANT was a GRANT ALL ON object TO user. a List with TableGrant objects.



getTableIndexInformation
public DataStore getTableIndexInformation(TableIdentifier table)(Code)
Return the index information for a table as a DataStore. This is delegated to getTableIndexList() and from the resulting collection the datastore is created.
Parameters:
  table - the table to get the indexes for
See Also:   DbMetadata.getTableIndexList(TableIdentifier)



getTableIndexList
public Collection<IndexDefinition> getTableIndexList(TableIdentifier table)(Code)
Returns a list of indexes defined for the given table
Parameters:
  table - the table to get the indexes for



getTableList
public List<TableIdentifier> getTableList(String schema, String[] types) throws SQLException(Code)



getTableList
public List<TableIdentifier> getTableList(String table, String schema) throws SQLException(Code)



getTableList
public List<TableIdentifier> getTableList(String table, String schema, String[] types) throws SQLException(Code)



getTableList
public List<TableIdentifier> getTableList(String table, String schema, String[] types, boolean returnAllSchemas) throws SQLException(Code)
Return a list of tables for the given schema if the schema is null, all tables will be returned



getTableSource
public String getTableSource(TableIdentifier table, boolean includeDrop, boolean includeFk) throws SQLException(Code)
Return the SQL statement to re-create the given table. (in the dialect for the current DBMS) the SQL statement to create the given table.
Parameters:
  table - the table for which the source should be retrievedcatalog The catalog in which the table is defined. This should be null if the DBMS does not support catalogs
Parameters:
  includeDrop - If true, a DROP TABLE statement will be included in the generated SQL script.
Parameters:
  includeFk - if true, the foreign key constraints will be added after the CREATE TABLE
throws:
  SQLException -



getTableSource
public String getTableSource(TableIdentifier table, List<ColumnIdentifier> columns, String tableNameToUse)(Code)



getTableSource
public String getTableSource(TableIdentifier table, DataStore columns, DataStore aIndexDef, DataStore aFkDef, boolean includeDrop, String tableNameToUse)(Code)



getTableSource
public String getTableSource(TableIdentifier table, List<ColumnIdentifier> columns, DataStore aIndexDef, DataStore aFkDef, boolean includeDrop, String tableNameToUse, boolean includeFk)(Code)



getTableTriggers
public DataStore getTableTriggers(TableIdentifier table) throws SQLException(Code)
Return the list of defined triggers for the given table.



getTableType
public String getTableType(TableIdentifier table) throws SQLException(Code)



getTableTypeName
public String getTableTypeName()(Code)



getTableTypes
public Collection<String> getTableTypes()(Code)



getTables
public DataStore getTables() throws SQLException(Code)



getTables
public DataStore getTables(String aCatalog, String aSchema, String[] types) throws SQLException(Code)



getTables
public DataStore getTables(String aCatalog, String aSchema, String tables, String[] types) throws SQLException(Code)



getTriggerSource
public String getTriggerSource(String aCatalog, String aSchema, String aTriggername) throws SQLException(Code)
Retrieve the SQL Source of the given trigger.
Parameters:
  aCatalog - The catalog in which the trigger is defined. This should be null if the DBMS does not support catalogs
Parameters:
  aSchema - The schema in which the trigger is defined. This should be null if the DBMS does not support schemas
Parameters:
  aTriggername -
throws:
  SQLException - the trigger source



getTriggers
public DataStore getTriggers(String catalog, String schema) throws SQLException(Code)
Return a list of triggers available in the given schema.



getTriggers
protected DataStore getTriggers(String catalog, String schema, String tableName) throws SQLException(Code)



getViewSource
public CharSequence getViewSource(TableIdentifier viewId)(Code)
Return the source of a view definition as it is stored in the database. Usually (depending on how the meta data is stored in the database) the DBMS only stores the underlying SELECT statement, and that will be returned by this method. To create a complete SQL to re-create a view, use DbMetadata.getExtendedViewSource(TableIdentifier,DataStore,boolean) the view source as stored in the database.



getViewTypeName
public String getViewTypeName()(Code)



getWbConnection
public WbConnection getWbConnection()(Code)



ignoreCatalog
public boolean ignoreCatalog(String catalog)(Code)



ignoreSchema
public boolean ignoreSchema(String schema)(Code)



isApacheDerby
public boolean isApacheDerby()(Code)



isCaseSensitive
public boolean isCaseSensitive()(Code)



isDefaultCase
public boolean isDefaultCase(String name)(Code)
Returns true if the given object name needs quoting due to mixed case writing or because the case of the name does not match the case in which the database stores its objects



isFirebird
public boolean isFirebird()(Code)



isHsql
public boolean isHsql()(Code)



isKeyword
public boolean isKeyword(String name)(Code)



isMySql
public boolean isMySql()(Code)



isOracle
public boolean isOracle()(Code)



isPostgres
public boolean isPostgres()(Code)



isSelectIntoNewTable
public boolean isSelectIntoNewTable(String sql)(Code)
Checks if the given SQL string is actually some kind of table creation "disguised" as a SELECT. Whether a statement is identified as a SELECT into a new table is defined through the regular expression that can be set for the DBMS using the property: workbench.sql.[dbid].selectinto.pattern This method returns true if a Regex has been defined and matches the given SQL



isSqlServer
public boolean isSqlServer()(Code)



isTableType
public boolean isTableType(String type)(Code)



needCatalogInDML
public boolean needCatalogInDML(TableIdentifier table)(Code)



needSchemaInDML
public boolean needSchemaInDML(TableIdentifier table)(Code)
Check if the given TableIdentifier requires the usage of the schema for a DML (select, insert, update, delete) statement. By default this is not required for an Oracle connetion where the schema is the current user. For all other DBMS, the usage can be disabled by setting a property in the configuration file



objectExists
public boolean objectExists(TableIdentifier aTable, String type)(Code)



objectExists
public boolean objectExists(TableIdentifier aTable, String[] types)(Code)



objectTypeCanContainData
public boolean objectTypeCanContainData(String type)(Code)
Check if the given DB object type can contain data. i.e. if a SELECT FROM can be run against this type



procedureExists
public boolean procedureExists(ProcedureDefinition def)(Code)



quoteObjectname
public String quoteObjectname(String aName)(Code)



quoteObjectname
public String quoteObjectname(String aName, boolean quoteAlways)(Code)
Encloses the given object name in double quotes if necessary. Quoting of names is necessary if the name is a reserved word in the database. To check if the given name is a keyword, it is compared to the words returned by getSQLKeywords(). If the given name is not a keyword, workbench.util.SqlUtil.quoteObjectname(String) will be called to check if the name contains special characters which require double quotes around the object name. For Oracle and HSQL strings starting with a digit will always be quoted.



readProcedureSource
public void readProcedureSource(ProcedureDefinition def) throws NoConfigException(Code)



resolveSynonym
public TableIdentifier resolveSynonym(TableIdentifier tbl)(Code)
If the passed TableIdentifier is a Synonym and the current DBMS supports synonyms, a TableIdentifier for the "real" table is returned. Otherwise the passed TableIdentifier is returned



setCurrentCatalog
public boolean setCurrentCatalog(String newCatalog) throws SQLException(Code)
Changes the current catalog using Connection.setCatalog() and notifies the connection object about the change.
Parameters:
  newCatalog - the name of the new catalog/database that should be selected
See Also:   WbConnection.catalogChanged(StringString)



storesLowerCaseIdentifiers
public boolean storesLowerCaseIdentifiers()(Code)
Returns true if the server stores identifiers in lower case. Usually this is delegated to the JDBC driver, but as some drivers (e.g. Frontbase) implement this incorrectly, this can be overriden in workbench.settings with the property: workbench.db.objectname.case.



storesLowerCaseSchemas
public boolean storesLowerCaseSchemas()(Code)



storesMixedCaseIdentifiers
public boolean storesMixedCaseIdentifiers()(Code)
Returns true if the server stores identifiers in mixed case. Usually this is delegated to the JDBC driver, but as some drivers (e.g. Frontbase) implement this incorrectly, this can be overriden in workbench.settings with the property: workbench.db.[dbid].objectname.case



storesUpperCaseIdentifiers
public boolean storesUpperCaseIdentifiers()(Code)
Returns true if the server stores identifiers in upper case. Usually this is delegated to the JDBC driver, but as some drivers (e.g. Frontbase) implement this incorrectly, this can be overriden in workbench.settings



storesUpperCaseSchemas
public boolean storesUpperCaseSchemas()(Code)



supportsBatchUpdates
public boolean supportsBatchUpdates()(Code)
Wrapper for DatabaseMetaData.supportsBatchUpdates() that throws no exception. If any error occurs, false will be returned



supportsCatalogs
public boolean supportsCatalogs()(Code)



supportsMixedCaseIdentifiers
protected boolean supportsMixedCaseIdentifiers()(Code)



supportsMixedCaseQuotedIdentifiers
protected boolean supportsMixedCaseQuotedIdentifiers()(Code)



supportsSelectIntoNewTable
public boolean supportsSelectIntoNewTable()(Code)
Returns true if the current DBMS supports a SELECT syntax which creates a new table (e.g. SELECT .. INTO new_table FROM old_table) It simply checks if a regular expression has been defined to detect this kind of statements
See Also:   DbMetadata.isSelectIntoNewTable(String)



supportsSynonyms
public boolean supportsSynonyms()(Code)
Checks if the current DBMS supports synonyms. true if the synonym support is available (basically if synonymReader != null)



tableExists
public boolean tableExists(TableIdentifier aTable)(Code)
Check if the given table exists in the database



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.