📄 databasemetadata.java
字号:
/* Derby - Class org.apache.derby.client.am.DatabaseMetaData Copyright (c) 2001, 2005 The Apache Software Foundation or its licensors, where applicable. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*/package org.apache.derby.client.am;import org.apache.derby.jdbc.ClientDataSource;// Note:// Tag members using the strictest visibility.// Note:// Mark methods synchronized if and only if they update object state and are public.// Not yet done:// Application heap data should be copied for shiraz.// Save for future pass to avoid clutter during development.// Not yet done:// Apply meaning-preserving program transformations for performance,// including the replacement of slow ADTs with faster unsynchronized ADTs.// Save for future pass to avoid clutter during development.// Not yet done:// Assign an ErrorKey, ResourceKey, and Resource for each throw statement.// Save for future pass to avoid maintenance during development.public abstract class DatabaseMetaData implements java.sql.DatabaseMetaData { //----------------------------- constants ----------------------------------- private final static short SQL_BEST_ROWID = 1; private final static short SQL_ROWVER = 2; private final static short SQL_INDEX_UNIQUE = 0; private final static short SQL_INDEX_ALL = 1; //---------------------navigational members----------------------------------- protected Agent agent_; protected Connection connection_; //-----------------------------state------------------------------------------ private final static int numberOfMetaDataInfoMethods__ = 108; private Object[] metaDataInfoCache_ = new Object[numberOfMetaDataInfoMethods__]; private boolean metaDataInfoIsCached_ = false; public ProductLevel productLevel_; private ResultSet lastGetColumnPrivilegesResultSet_ = null; private ResultSet lastGetColumnsResultSet_ = null; private ResultSet lastGetForeignKeysResultSet_ = null; private ResultSet lastGetPrimaryKeysResultSet_ = null; private ResultSet lastGetProcedureColumnsResultSet_ = null; private ResultSet lastGetProceduresResultSet_ = null; private ResultSet lastGetSpecialColumnsResultSet_ = null; private ResultSet lastGetStatisticsResultSet_ = null; private ResultSet lastGetTablePrivilegesResultSet_ = null; private ResultSet lastGetTablesResultSet_ = null; private ResultSet lastGetUDTsResultSet_ = null; private ResultSet lastGetTypeInfoResultSet_ = null; private ResultSet lastGetAttrResultSet_ = null; private ResultSet lastGetSuperTypesResultSet_ = null; private ResultSet lastGetSuperTablesResultSet_ = null; public boolean useServerXAState_ = true; //---------------------constructors/finalizer--------------------------------- protected DatabaseMetaData(Agent agent, Connection connection, ProductLevel productLevel) { agent_ = agent; connection_ = connection; productLevel_ = productLevel; computeFeatureSet_(); if (connection.isXAConnection()) { connection.xaHostVersion_ = productLevel_.versionLevel_; } } // ---------------------------jdbc 1------------------------------------------ //---------------------------------------------------------------------- // First, a variety of minor information about the target database. private final static int allProceduresAreCallable__ = 0; public boolean allProceduresAreCallable() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(allProceduresAreCallable__); } private final static int allTablesAreSelectable__ = 1; public boolean allTablesAreSelectable() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(allTablesAreSelectable__); } private final static int nullsAreSortedHigh__ = 2; public boolean nullsAreSortedHigh() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(nullsAreSortedHigh__); } private final static int nullsAreSortedLow__ = 3; public boolean nullsAreSortedLow() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(nullsAreSortedLow__); } private final static int nullsAreSortedAtStart__ = 4; public boolean nullsAreSortedAtStart() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(nullsAreSortedAtStart__); } private final static int nullsAreSortedAtEnd__ = 5; public boolean nullsAreSortedAtEnd() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(nullsAreSortedAtEnd__); } private final static int usesLocalFiles__ = 6; public boolean usesLocalFiles() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(usesLocalFiles__); } private final static int usesLocalFilePerTable__ = 7; public boolean usesLocalFilePerTable() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(usesLocalFilePerTable__); } private final static int storesUpperCaseIdentifiers__ = 8; public boolean storesUpperCaseIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesUpperCaseIdentifiers__); } private final static int storesLowerCaseIdentifiers__ = 9; public boolean storesLowerCaseIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesLowerCaseIdentifiers__); } private final static int storesMixedCaseIdentifiers__ = 10; public boolean storesMixedCaseIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesMixedCaseIdentifiers__); } private final static int storesUpperCaseQuotedIdentifiers__ = 11; public boolean storesUpperCaseQuotedIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesUpperCaseQuotedIdentifiers__); } private final static int storesLowerCaseQuotedIdentifiers__ = 12; public boolean storesLowerCaseQuotedIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesLowerCaseQuotedIdentifiers__); } private final static int storesMixedCaseQuotedIdentifiers__ = 13; public boolean storesMixedCaseQuotedIdentifiers() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(storesMixedCaseQuotedIdentifiers__); } private final static int getSQLKeywords__ = 14; public String getSQLKeywords() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getSQLKeywords__); } private final static int getNumericFunctions__ = 15; public String getNumericFunctions() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getNumericFunctions__); } private final static int getStringFunctions__ = 16; public String getStringFunctions() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getStringFunctions__); } private final static int getSystemFunctions__ = 17; public String getSystemFunctions() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getSystemFunctions__); } private final static int getTimeDateFunctions__ = 18; public String getTimeDateFunctions() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getTimeDateFunctions__); } private final static int getSearchStringEscape__ = 19; public String getSearchStringEscape() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getSearchStringEscape__); } private final static int getExtraNameCharacters__ = 20; public String getExtraNameCharacters() throws SqlException { checkForClosedConnection(); return getMetaDataInfoString(getExtraNameCharacters__); } private final static int supportsAlterTableWithAddColumn__ = 21; public boolean supportsAlterTableWithAddColumn() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsAlterTableWithAddColumn__); } private final static int supportsAlterTableWithDropColumn__ = 22; public boolean supportsAlterTableWithDropColumn() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsAlterTableWithDropColumn__); } private final static int supportsConvert__ = 23; public boolean supportsConvert() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsConvert__); } private final static int supportsConvertType__ = 24; public boolean supportsConvert(int fromType, int toType) throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean_supportsConvert(supportsConvertType__, fromType, toType); } private final static int supportsDifferentTableCorrelationNames__ = 25; public boolean supportsDifferentTableCorrelationNames() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsDifferentTableCorrelationNames__); } private final static int supportsExpressionsInOrderBy__ = 26; public boolean supportsExpressionsInOrderBy() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsExpressionsInOrderBy__); } private final static int supportsOrderByUnrelated__ = 27; public boolean supportsOrderByUnrelated() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsOrderByUnrelated__); } private final static int supportsGroupBy__ = 28; public boolean supportsGroupBy() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsGroupBy__); } private final static int supportsGroupByUnrelated__ = 29; public boolean supportsGroupByUnrelated() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsGroupByUnrelated__); } private final static int supportsGroupByBeyondSelect__ = 30; public boolean supportsGroupByBeyondSelect() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsGroupByBeyondSelect__); } private final static int supportsMultipleResultSets__ = 31; public boolean supportsMultipleResultSets() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsMultipleResultSets__); } private final static int supportsMultipleTransactions__ = 32; public boolean supportsMultipleTransactions() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsMultipleTransactions__); } private final static int supportsCoreSQLGrammar__ = 33; public boolean supportsCoreSQLGrammar() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsCoreSQLGrammar__); } private final static int supportsExtendedSQLGrammar__ = 34; public boolean supportsExtendedSQLGrammar() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsExtendedSQLGrammar__); } private final static int supportsANSI92IntermediateSQL__ = 35; public boolean supportsANSI92IntermediateSQL() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsANSI92IntermediateSQL__); } private final static int supportsANSI92FullSQL__ = 36; public boolean supportsANSI92FullSQL() throws SqlException { checkForClosedConnection(); return getMetaDataInfoBoolean(supportsANSI92FullSQL__);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -