0001: /*
0002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003: *
0004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005: *
0006: * The contents of this file are subject to the terms of either the GNU
0007: * General Public License Version 2 only ("GPL") or the Common
0008: * Development and Distribution License("CDDL") (collectively, the
0009: * "License"). You may not use this file except in compliance with the
0010: * License. You can obtain a copy of the License at
0011: * http://www.netbeans.org/cddl-gplv2.html
0012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013: * specific language governing permissions and limitations under the
0014: * License. When distributing the software, include this License Header
0015: * Notice in each file and include the License file at
0016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
0017: * particular file as subject to the "Classpath" exception as provided
0018: * by Sun in the GPL Version 2 section of the License file that
0019: * accompanied this code. If applicable, add the following below the
0020: * License Header, with the fields enclosed by brackets [] replaced by
0021: * your own identifying information:
0022: * "Portions Copyrighted [year] [name of copyright owner]"
0023: *
0024: * Contributor(s):
0025: *
0026: * The Original Software is NetBeans. The Initial Developer of the Original
0027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
0028: * Microsystems, Inc. All Rights Reserved.
0029: *
0030: * If you wish your version of this file to be governed by only the CDDL
0031: * or only the GPL Version 2, indicate your decision by adding
0032: * "[Contributor] elects to include this software in this distribution
0033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034: * single choice of license, a recipient has the option to distribute
0035: * your version of this file under either the CDDL, the GPL Version 2 or
0036: * to extend the choice of license to its licensees as provided above.
0037: * However, if you add GPL Version 2 code and therefore, elected the GPL
0038: * Version 2 license, then the option applies only if the new code is
0039: * made subject to such option by the copyright holder.
0040: */
0041:
0042: package org.netbeans.lib.ddl.adaptors;
0043:
0044: import java.beans.PropertyChangeListener;
0045: import java.beans.PropertyChangeSupport;
0046: import java.io.Serializable;
0047: import java.sql.Connection;
0048: import java.sql.DatabaseMetaData;
0049: import java.sql.PreparedStatement;
0050: import java.sql.ResultSet;
0051: import java.sql.RowIdLifetime;
0052: import java.sql.SQLException;
0053: import java.util.HashMap;
0054: import java.util.Map;
0055: import java.util.ResourceBundle;
0056:
0057: import org.openide.util.NbBundle;
0058:
0059: public class DefaultAdaptor implements DatabaseMetaDataAdaptor,
0060: Serializable {
0061:
0062: private transient Connection con;
0063: private transient DatabaseMetaData dmd;
0064: protected Map properties;
0065: private transient PropertyChangeSupport propertySupport;
0066:
0067: private ResourceBundle bundle = NbBundle
0068: .getBundle("org.netbeans.lib.ddl.resources.Bundle"); // NOI18N
0069:
0070: public static final int NOT_SET = 0;
0071: public static final String NOT_SET_STRING = "";
0072:
0073: public static final int YES = 1;
0074: public static final int NO = 2;
0075:
0076: public static final int NULLSORT_HIGH = 1;
0077: public static final int NULLSORT_LOW = 2;
0078: public static final int NULLSORT_START = 3;
0079: public static final int NULLSORT_END = 4;
0080:
0081: public static final int STORE_LOWERCASE = 1;
0082: public static final int STORE_UPPERCASE = 2;
0083: public static final int STORE_MIXEDCASE = 3;
0084:
0085: // Boolean properties
0086:
0087: public static final String PROP_PROCEDURES_ARE_CALLABLE = "proceduresAreCallable"; // NOI18N
0088: public static final String PROP_TABLES_ARE_SELECTABLE = "tablesAreSelectable"; // NOI18N
0089: public static final String PROP_READONLY = "readOnly"; // NOI18N
0090: public static final String PROP_LOCAL_FILES = "localFiles"; // NOI18N
0091: public static final String PROP_FILE_PER_TABLE = "localFilePerTable"; // NOI18N
0092: public static final String PROP_MIXEDCASE_IDENTIFIERS = "mixedCaseIdentifiers"; // NOI18N
0093: public static final String PROP_MIXEDCASE_QUOTED_IDENTIFIERS = "mixedCaseQuotedIdentifiers"; // NOI18N
0094: public static final String PROP_ALTER_ADD = "alterTableWithAddColumn"; // NOI18N
0095: public static final String PROP_ALTER_DROP = "alterTableWithDropColumn"; // NOI18N
0096: public static final String PROP_COLUMN_ALIASING = "columnAliasing"; // NOI18N
0097: public static final String PROP_NULL_PLUS_NULL_IS_NULL = "nullPlusNonNullIsNull"; // NOI18N
0098: public static final String PROP_CONVERT = "convert"; // NOI18N
0099: public static final String PROP_TABLE_CORRELATION_NAMES = "tableCorrelationNames"; // NOI18N
0100: public static final String PROP_DIFF_TABLE_CORRELATION_NAMES = "differentTableCorrelationNames"; // NOI18N
0101: public static final String PROP_EXPRESSIONS_IN_ORDERBY = "expressionsInOrderBy"; // NOI18N
0102: public static final String PROP_ORDER_BY_UNRELATED = "orderByUnrelated"; // NOI18N
0103: public static final String PROP_GROUP_BY = "groupBy"; // NOI18N
0104: public static final String PROP_UNRELATED_GROUP_BY = "groupByUnrelated"; // NOI18N
0105: public static final String PROP_BEYOND_GROUP_BY = "groupByBeyondSelect"; // NOI18N
0106: public static final String PROP_ESCAPE_LIKE = "likeEscapeClause"; // NOI18N
0107: public static final String PROP_MULTIPLE_RS = "multipleResultSets"; // NOI18N
0108: public static final String PROP_MULTIPLE_TRANSACTIONS = "multipleTransactions"; // NOI18N
0109: public static final String PROP_NON_NULL_COLUMNSS = "nonNullableColumns"; // NOI18N
0110: public static final String PROP_MINUMUM_SQL_GRAMMAR = "minimumSQLGrammar"; // NOI18N
0111: public static final String PROP_CORE_SQL_GRAMMAR = "coreSQLGrammar"; // NOI18N
0112: public static final String PROP_EXTENDED_SQL_GRAMMAR = "extendedSQLGrammar"; // NOI18N
0113: public static final String PROP_ANSI_SQL_GRAMMAR = "ANSI92EntryLevelSQL"; // NOI18N
0114: public static final String PROP_INTERMEDIATE_SQL_GRAMMAR = "ANSI92IntermediateSQL"; // NOI18N
0115: public static final String PROP_FULL_SQL_GRAMMAR = "ANSI92FullSQL"; // NOI18N
0116: public static final String PROP_INTEGRITY_ENHANCEMENT = "IntegrityEnhancementFacility"; // NOI18N
0117: public static final String PROP_OUTER_JOINS = "outerJoins"; // NOI18N
0118: public static final String PROP_FULL_OUTER_JOINS = "fullOuterJoins"; // NOI18N
0119: public static final String PROP_LIMITED_OUTER_JOINS = "limitedOuterJoins"; // NOI18N
0120: public static final String PROP_CATALOG_AT_START = "catalogAtStart"; // NOI18N
0121: public static final String PROP_SCHEMAS_IN_DML = "schemasInDataManipulation"; // NOI18N
0122: public static final String PROP_SCHEMAS_IN_PROCEDURE_CALL = "schemasInProcedureCalls"; // NOI18N
0123: public static final String PROP_SCHEMAS_IN_TABLE_DEFINITION = "schemasInTableDefinitions"; // NOI18N
0124: public static final String PROP_SCHEMAS_IN_INDEX = "schemasInIndexDefinitions"; // NOI18N
0125: public static final String PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION = "schemasInPrivilegeDefinitions"; // NOI18N
0126: public static final String PROP_CATALOGS_IN_DML = "catalogsInDataManipulation"; // NOI18N
0127: public static final String PROP_CATALOGS_IN_PROCEDURE_CALL = "catalogsInProcedureCalls"; // NOI18N
0128: public static final String PROP_CATALOGS_IN_TABLE_DEFINITION = "catalogsInTableDefinitions"; // NOI18N
0129: public static final String PROP_CATALOGS_IN_INDEX = "catalogsInIndexDefinitions"; // NOI18N
0130: public static final String PROP_CATALOGS_IN_PRIVILEGE_DEFINITION = "catalogsInPrivilegeDefinitions"; // NOI18N
0131: public static final String PROP_POSITIONED_DELETE = "positionedDelete"; // NOI18N
0132: public static final String PROP_POSITIONED_UPDATE = "positionedUpdate"; // NOI18N
0133: public static final String PROP_SELECT_FOR_UPDATE = "selectForUpdate"; // NOI18N
0134: public static final String PROP_STORED_PROCEDURES = "storedProcedures"; // NOI18N
0135: public static final String PROP_SUBQUERY_IN_COMPARSIONS = "subqueriesInComparisons"; // NOI18N
0136: public static final String PROP_SUBQUERY_IN_EXISTS = "subqueriesInExists"; // NOI18N
0137: public static final String PROP_SUBQUERY_IN_INS = "subqueriesInIns"; // NOI18N
0138: public static final String PROP_SUBQUERY_IN_QUANTIFIEDS = "subqueriesInQuantifieds"; // NOI18N
0139: public static final String PROP_CORRELATED_SUBQUERIES = "correlatedSubqueries"; // NOI18N
0140: public static final String PROP_UNION = "union"; // NOI18N
0141: public static final String PROP_UNION_ALL = "unionAll"; // NOI18N
0142: public static final String PROP_OPEN_CURSORS_ACROSS_COMMIT = "openCursorsAcrossCommit"; // NOI18N
0143: public static final String PROP_OPEN_CURSORS_ACROSS_ROLLBACK = "openCursorsAcrossRollback"; // NOI18N
0144: public static final String PROP_OPEN_STATEMENTS_ACROSS_COMMIT = "openStatementsAcrossCommit"; // NOI18N
0145: public static final String PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK = "openStatementsAcrossRollback"; // NOI18N
0146: public static final String PROP_ROWSIZE_INCLUDING_BLOBS = "maxRowSizeIncludeBlobs"; // NOI18N
0147: public static final String PROP_TRANSACTIONS = "transactions"; // NOI18N
0148: public static final String PROP_DDL_AND_DML_TRANSACTIONS = "dataDefinitionAndDataManipulationTransactions"; // NOI18N
0149: public static final String PROP_DML_TRANSACTIONS_ONLY = "dataManipulationTransactionsOnly"; // NOI18N
0150: public static final String PROP_DDL_CAUSES_COMMIT = "dataDefinitionCausesTransactionCommit"; // NOI18N
0151: public static final String PROP_DDL_IGNORED_IN_TRANSACTIONS = "dataDefinitionIgnoredInTransactions"; // NOI18N
0152: public static final String PROP_BATCH_UPDATES = "batchUpdates"; // NOI18N
0153:
0154: // Integer properties
0155:
0156: public static final String PROP_NULL_SORT = "nullSort"; // NOI18N
0157: public static final String PROP_IDENTIFIER_STORE = "identifierStore"; // NOI18N
0158: public static final String PROP_QUOTED_IDENTS = "quotedIdentifierStore"; // NOI18N
0159: public static final String PROP_MAX_BINARY_LITERAL_LENGTH = "maxBinaryLiteralLength"; // NOI18N
0160: public static final String PROP_MAX_CHAR_LITERAL_LENGTH = "maxCharLiteralLength"; // NOI18N
0161: public static final String PROP_MAX_COLUMN_NAME_LENGTH = "maxColumnNameLength"; // NOI18N
0162: public static final String PROP_MAX_COLUMNS_IN_GROUPBY = "maxColumnsInGroupBy"; // NOI18N
0163: public static final String PROP_MAX_COLUMNS_IN_INDEX = "maxColumnsInIndex"; // NOI18N
0164: public static final String PROP_MAX_COLUMNS_IN_ORDERBY = "maxColumnsInOrderBy"; // NOI18N
0165: public static final String PROP_MAX_COLUMNS_IN_SELECT = "maxColumnsInSelect"; // NOI18N
0166: public static final String PROP_MAX_COLUMNS_IN_TABLE = "maxColumnsInTable"; // NOI18N
0167: public static final String PROP_MAX_CONNECTIONS = "maxConnections"; // NOI18N
0168: public static final String PROP_MAX_CURSORNAME_LENGTH = "maxCursorNameLength"; // NOI18N
0169: public static final String PROP_MAX_INDEX_LENGTH = "maxIndexLength"; // NOI18N
0170: public static final String PROP_MAX_SCHEMA_NAME = "maxSchemaNameLength"; // NOI18N
0171: public static final String PROP_MAX_PROCEDURE_NAME = "maxProcedureNameLength"; // NOI18N
0172: public static final String PROP_MAX_CATALOG_NAME = "maxCatalogNameLength"; // NOI18N
0173: public static final String PROP_MAX_ROW_SIZE = "maxRowSize"; // NOI18N
0174: public static final String PROP_MAX_STATEMENT_LENGTH = "maxStatementLength"; // NOI18N
0175: public static final String PROP_MAX_STATEMENTS = "maxStatements"; // NOI18N
0176: public static final String PROP_MAX_TABLENAME_LENGTH = "maxTableNameLength"; // NOI18N
0177: public static final String PROP_MAX_TABLES_IN_SELECT = "maxTablesInSelect"; // NOI18N
0178: public static final String PROP_MAX_USERNAME = "maxUserNameLength"; // NOI18N
0179: public static final String PROP_DEFAULT_ISOLATION = "defaultTransactionIsolation"; // NOI18N
0180:
0181: // String properties
0182:
0183: public static final String PROP_URL = "URL"; // NOI18N
0184: public static final String PROP_USERNAME = "userName"; // NOI18N
0185: public static final String PROP_PRODUCTNAME = "databaseProductName"; // NOI18N
0186: public static final String PROP_PRODUCTVERSION = "databaseProductVersion"; // NOI18N
0187: public static final String PROP_DRIVERNAME = "driverName"; // NOI18N
0188: public static final String PROP_DRIVER_VERSION = "driverVersion"; // NOI18N
0189: public static final String PROP_DRIVER_MAJOR_VERSION = "driverMajorVersion"; // NOI18N
0190: public static final String PROP_DRIVER_MINOR_VERSION = "driverMinorVersion"; // NOI18N
0191: public static final String PROP_IDENTIFIER_QUOTE = "identifierQuoteString"; // NOI18N
0192: public static final String PROP_SQL_KEYWORDS = "SQLKeywords"; // NOI18N
0193: public static final String PROP_NUMERIC_FUNCTIONS = "numericFunctions"; // NOI18N
0194: public static final String PROP_STRING_FUNCTIONS = "stringFunctions"; // NOI18N
0195: public static final String PROP_SYSTEM_FUNCTIONS = "systemFunctions"; // NOI18N
0196: public static final String PROP_TIME_FUNCTIONS = "timeDateFunctions"; // NOI18N
0197: public static final String PROP_STRING_ESCAPE = "searchStringEscape"; // NOI18N
0198: public static final String PROP_EXTRA_CHARACTERS = "extraNameCharacters"; // NOI18N
0199: public static final String PROP_SCHEMA_TERM = "schemaTerm"; // NOI18N
0200: public static final String PROP_PROCEDURE_TERM = "procedureTerm"; // NOI18N
0201: public static final String PROP_CATALOG_TERM = "catalogTerm"; // NOI18N
0202: public static final String PROP_CATALOGS_SEPARATOR = "catalogSeparator"; // NOI18N
0203:
0204: // Queries
0205:
0206: public static final String PROP_PROCEDURES_QUERY = "proceduresQuery"; // NOI18N
0207: public static final String PROP_PROCEDURE_COLUMNS_QUERY = "procedureColumnsQuery"; // NOI18N
0208: public static final String PROP_SCHEMAS_QUERY = "schemasQuery"; // NOI18N
0209: public static final String PROP_CATALOGS_QUERY = "catalogsQuery"; // NOI18N
0210: public static final String PROP_TABLES_QUERY = "tablesQuery"; // NOI18N
0211: public static final String PROP_TABLE_TYPES_QUERY = "tableTypesQuery"; // NOI18N
0212: public static final String PROP_COLUMNS_QUERY = "columnsQuery"; // NOI18N
0213: public static final String PROP_COLUMNS_PRIVILEGES_QUERY = "columnPrivilegesQuery"; // NOI18N
0214: public static final String PROP_TABLE_PRIVILEGES_QUERY = "tablePrivilegesQuery"; // NOI18N
0215: public static final String PROP_BEST_ROW_IDENTIFIER = "bestRowIdentifierQuery"; // NOI18N
0216: public static final String PROP_VERSION_COLUMNS = "versionColumnsQuery"; // NOI18N
0217: public static final String PROP_PK_QUERY = "primaryKeysQuery"; // NOI18N
0218: public static final String PROP_IK_QUERY = "importedKeysQuery"; // NOI18N
0219: public static final String PROP_EK_QUERY = "exportedKeysQuery"; // NOI18N
0220: public static final String PROP_CROSSREF_QUERY = "crossReferenceQuery"; // NOI18N
0221: public static final String PROP_TYPE_INFO_QUERY = "typeInfoQuery"; // NOI18N
0222: public static final String PROP_INDEX_INFO_QUERY = "indexInfoQuery"; // NOI18N
0223: public static final String PROP_UDT_QUERY = "UDTsQuery"; // NOI18N
0224:
0225: // Extended
0226:
0227: public static final String PROP_CAPITALIZE_USERNAME = "capitializeUsername"; // NOI18N
0228:
0229: static final long serialVersionUID = 2490518619095829944L;
0230:
0231: public DefaultAdaptor() {
0232: propertySupport = new PropertyChangeSupport(this );
0233: properties = new HashMap();
0234: }
0235:
0236: public DefaultAdaptor(Connection conn) throws SQLException {
0237: propertySupport = new PropertyChangeSupport(this );
0238: properties = new HashMap();
0239: con = conn;
0240: if (con != null)
0241: dmd = con.getMetaData();
0242: else
0243: dmd = null;
0244: }
0245:
0246: public void addPropertyChangeListener(
0247: PropertyChangeListener listener) {
0248: propertySupport.addPropertyChangeListener(listener);
0249: }
0250:
0251: public void removePropertyChangeListener(
0252: PropertyChangeListener listener) {
0253: propertySupport.removePropertyChangeListener(listener);
0254: }
0255:
0256: public DatabaseMetaData getMetaData() {
0257: return this ;
0258: }
0259:
0260: /**
0261: * Retrieves the connection that produced this metadata object.
0262: * @return the connection that produced this metadata object
0263: */
0264: public Connection getConnection() throws SQLException {
0265: return con;
0266: }
0267:
0268: /**
0269: * Sets the connection that produced this metadata object.
0270: * @return the connection that produced this metadata object
0271: */
0272: public void setConnection(Connection conn) throws SQLException {
0273: con = conn;
0274: if (con != null)
0275: dmd = con.getMetaData();
0276: else
0277: dmd = null;
0278: }
0279:
0280: private int getBoolean(String key) {
0281: Boolean val = (Boolean) properties.get(key);
0282: if (val != null)
0283: return (val.booleanValue() ? YES : NO);
0284: return NOT_SET;
0285: }
0286:
0287: private void setBoolean(String key, int value) {
0288: Boolean newValue, oldValue = (Boolean) properties.get(key);
0289: if (value != NOT_SET) {
0290: newValue = value == YES ? Boolean.TRUE : Boolean.FALSE;
0291: properties.put(key, newValue);
0292: } else {
0293: newValue = null;
0294: properties.remove(key);
0295: }
0296:
0297: propertySupport.firePropertyChange(key, oldValue, newValue);
0298: }
0299:
0300: private int getInt(String key) {
0301: Integer val = (Integer) properties.get(key);
0302: if (val == null)
0303: return NOT_SET;
0304: return val.intValue();
0305: }
0306:
0307: private void setInt(String key, int value) {
0308: Integer newValue, oldValue = (Integer) properties.get(key);
0309: if (value != NOT_SET) {
0310: newValue = new Integer(value);
0311: properties.put(key, newValue);
0312: } else {
0313: newValue = null;
0314: properties.remove(key);
0315: }
0316:
0317: propertySupport.firePropertyChange(key, oldValue, newValue);
0318: }
0319:
0320: private String getString(String key) {
0321: String val = (String) properties.get(key);
0322: if (val == null)
0323: return NOT_SET_STRING;
0324: return val;
0325: }
0326:
0327: private void setString(String key, String value) {
0328: String newValue, oldValue = (String) properties.get(key);
0329: if (value.length() > 0) {
0330: newValue = value;
0331: properties.put(key, newValue);
0332: } else {
0333: newValue = null;
0334: properties.remove(key);
0335: }
0336:
0337: propertySupport.firePropertyChange(key, oldValue, newValue);
0338: }
0339:
0340: // proceduresAreCallable
0341:
0342: public boolean allProceduresAreCallable() throws SQLException {
0343: Boolean proceduresAreCallable = (Boolean) properties
0344: .get(PROP_PROCEDURES_ARE_CALLABLE);
0345: if (proceduresAreCallable == null) {
0346: if (dmd != null)
0347: proceduresAreCallable = dmd.allProceduresAreCallable() ? Boolean.TRUE
0348: : Boolean.FALSE;
0349: else
0350: throw new SQLException(bundle
0351: .getString("EXC_NoDBMetadata")); // NOI18N
0352: properties.put(PROP_PROCEDURES_ARE_CALLABLE,
0353: proceduresAreCallable);
0354: }
0355:
0356: return proceduresAreCallable.booleanValue();
0357: }
0358:
0359: public int getProceduresAreCallable() {
0360: return getBoolean(PROP_PROCEDURES_ARE_CALLABLE);
0361: }
0362:
0363: public void setProceduresAreCallable(int value) throws SQLException {
0364: setBoolean(PROP_PROCEDURES_ARE_CALLABLE, value);
0365: }
0366:
0367: // tablesAreSelectable
0368:
0369: public boolean allTablesAreSelectable() throws SQLException {
0370: Boolean tablesAreSelectable = (Boolean) properties
0371: .get(PROP_TABLES_ARE_SELECTABLE);
0372: if (tablesAreSelectable == null) {
0373: if (dmd != null)
0374: tablesAreSelectable = dmd.allTablesAreSelectable() ? Boolean.TRUE
0375: : Boolean.FALSE;
0376: else
0377: throw new SQLException(bundle
0378: .getString("EXC_NoDBMetadata")); // NOI18N
0379: properties.put(PROP_TABLES_ARE_SELECTABLE,
0380: tablesAreSelectable);
0381: }
0382:
0383: return tablesAreSelectable.booleanValue();
0384: }
0385:
0386: public int getTablesAreSelectable() {
0387: return getBoolean(PROP_TABLES_ARE_SELECTABLE);
0388: }
0389:
0390: public void setTablesAreSelectable(int value) {
0391: setBoolean(PROP_TABLES_ARE_SELECTABLE, value);
0392: }
0393:
0394: // url
0395:
0396: public String getURL() throws SQLException {
0397: String url = (String) properties.get(PROP_URL);
0398: if (url == null) {
0399: if (dmd != null)
0400: url = dmd.getURL();
0401: else
0402: return NOT_SET_STRING;
0403: properties.put(PROP_URL, url);
0404: }
0405:
0406: return url;
0407: }
0408:
0409: public void setURL(String value) {
0410: setString(PROP_URL, value);
0411: }
0412:
0413: // username
0414:
0415: public String getUserName() throws SQLException {
0416: String username = (String) properties.get(PROP_USERNAME);
0417: if (username == null) {
0418: if (dmd != null)
0419: username = dmd.getUserName();
0420: else
0421: return NOT_SET_STRING;
0422: properties.put(PROP_USERNAME, username);
0423: }
0424:
0425: return username;
0426: }
0427:
0428: public void setUserName(String value) {
0429: setString(PROP_USERNAME, value);
0430: }
0431:
0432: // readonly
0433:
0434: public boolean isReadOnly() throws SQLException {
0435: Boolean readonly = (Boolean) properties.get(PROP_READONLY);
0436: if (readonly == null) {
0437: if (dmd != null)
0438: readonly = dmd.isReadOnly() ? Boolean.TRUE
0439: : Boolean.FALSE;
0440: else
0441: throw new SQLException(bundle
0442: .getString("EXC_NoDBMetadata")); // NOI18N
0443: properties.put(PROP_READONLY, readonly);
0444: }
0445:
0446: return readonly.booleanValue();
0447: }
0448:
0449: // public int getReadOnly() {
0450: public int getreadOnly() {
0451: return getBoolean(PROP_READONLY);
0452: }
0453:
0454: // public void setReadOnly(int flag) {
0455: public void setreadOnly(int flag) {
0456: setBoolean(PROP_READONLY, flag);
0457: }
0458:
0459: // nullSort
0460:
0461: public int getNullSort() {
0462: return getInt(PROP_NULL_SORT);
0463: }
0464:
0465: public void setNullSort(int value) {
0466: setInt(PROP_NULL_SORT, value);
0467: }
0468:
0469: public boolean nullsAreSortedHigh() throws SQLException {
0470: Integer nullSort = (Integer) properties.get(PROP_NULL_SORT);
0471: if (nullSort != null)
0472: return (nullSort.intValue() == NULLSORT_HIGH);
0473: if (dmd != null)
0474: return dmd.nullsAreSortedAtStart();
0475: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0476: }
0477:
0478: public boolean nullsAreSortedLow() throws SQLException {
0479: Integer nullSort = (Integer) properties.get(PROP_NULL_SORT);
0480: if (nullSort != null)
0481: return (nullSort.intValue() == NULLSORT_LOW);
0482: if (dmd != null)
0483: return dmd.nullsAreSortedLow();
0484: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0485: }
0486:
0487: public boolean nullsAreSortedAtStart() throws SQLException {
0488: Integer nullSort = (Integer) properties.get(PROP_NULL_SORT);
0489: if (nullSort != null)
0490: return (nullSort.intValue() == NULLSORT_START);
0491: if (dmd != null)
0492: return dmd.nullsAreSortedAtStart();
0493: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0494: }
0495:
0496: public boolean nullsAreSortedAtEnd() throws SQLException {
0497: Integer nullSort = (Integer) properties.get(PROP_NULL_SORT);
0498: if (nullSort != null)
0499: return (nullSort.intValue() == NULLSORT_END);
0500: if (dmd != null)
0501: return dmd.nullsAreSortedAtEnd();
0502: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0503: }
0504:
0505: // product
0506:
0507: public String getDatabaseProductName() throws SQLException {
0508: String product = (String) properties.get(PROP_PRODUCTNAME);
0509: if (product == null) {
0510: if (dmd != null)
0511: product = dmd.getDatabaseProductName().trim();
0512: else
0513: return NOT_SET_STRING;
0514: properties.put(PROP_PRODUCTNAME, product);
0515: }
0516:
0517: return product;
0518: }
0519:
0520: public void setDatabaseProductName(String value) {
0521: setString(PROP_PRODUCTNAME, value);
0522: }
0523:
0524: // version
0525:
0526: public String getDatabaseProductVersion() throws SQLException {
0527: String version = (String) properties.get(PROP_PRODUCTVERSION);
0528: if (version == null) {
0529: if (dmd != null)
0530: version = dmd.getDatabaseProductVersion();
0531: else
0532: return NOT_SET_STRING;
0533: properties.put(PROP_PRODUCTVERSION, version);
0534: }
0535:
0536: return version;
0537: }
0538:
0539: public void setDatabaseProductVersion(String value) {
0540: setString(PROP_PRODUCTVERSION, value);
0541: }
0542:
0543: // driverName
0544:
0545: public String getDriverName() throws SQLException {
0546: String driverName = (String) properties.get(PROP_DRIVERNAME);
0547: if (driverName == null) {
0548: if (dmd != null)
0549: driverName = dmd.getDriverName();
0550: else
0551: return NOT_SET_STRING;
0552: properties.put(PROP_DRIVERNAME, driverName);
0553: }
0554:
0555: return driverName;
0556: }
0557:
0558: public void setDriverName(String value) {
0559: setString(PROP_DRIVERNAME, value);
0560: }
0561:
0562: /**
0563: * What's the version of this JDBC driver?
0564: * @return JDBC driver version
0565: * @exception SQLException if a database access error occurs
0566: */
0567: public String getDriverVersion() throws SQLException {
0568: String driverVersion = (String) properties
0569: .get(PROP_DRIVER_VERSION);
0570: if (driverVersion == null) {
0571: if (dmd != null)
0572: driverVersion = dmd.getDriverVersion();
0573: else
0574: return NOT_SET_STRING;
0575: properties.put(PROP_DRIVER_VERSION, driverVersion);
0576: }
0577:
0578: return driverVersion;
0579: }
0580:
0581: public void setDriverVersion(String value) {
0582: setString(PROP_DRIVER_VERSION, value);
0583: }
0584:
0585: /**
0586: * What's this JDBC driver's major version number?
0587: * @return JDBC driver major version
0588: */
0589: public int getDriverMajorVersion() {
0590: Integer driverMajorVersion = (Integer) properties
0591: .get(PROP_DRIVER_MAJOR_VERSION);
0592: if (driverMajorVersion == null) {
0593: if (dmd != null)
0594: driverMajorVersion = new Integer(dmd
0595: .getDriverMajorVersion());
0596: else
0597: driverMajorVersion = new Integer(NOT_SET);
0598: properties.put(PROP_DRIVER_MAJOR_VERSION,
0599: driverMajorVersion);
0600: }
0601:
0602: return driverMajorVersion.intValue();
0603: }
0604:
0605: public void setDriverMajorVersion(int value) {
0606: setInt(PROP_DRIVER_MAJOR_VERSION, value);
0607: }
0608:
0609: /**
0610: * What's this JDBC driver's minor version number?
0611: * @return JDBC driver minor version number
0612: */
0613: public int getDriverMinorVersion() {
0614: Integer driverMinorVersion = (Integer) properties
0615: .get(PROP_DRIVER_MINOR_VERSION);
0616: if (driverMinorVersion == null) {
0617: if (dmd != null)
0618: driverMinorVersion = new Integer(dmd
0619: .getDriverMinorVersion());
0620: else
0621: driverMinorVersion = new Integer(NOT_SET);
0622: properties.put(PROP_DRIVER_MINOR_VERSION,
0623: driverMinorVersion);
0624: }
0625:
0626: return driverMinorVersion.intValue();
0627: }
0628:
0629: public void setDriverMinorVersion(int value) {
0630: setInt(PROP_DRIVER_MINOR_VERSION, value);
0631: }
0632:
0633: /**
0634: * Does the database store tables in a local file?
0635: * @return <code>true</code> if so
0636: * @exception SQLException if a database access error occurs
0637: */
0638: public boolean usesLocalFiles() throws SQLException {
0639: Boolean localFiles = (Boolean) properties.get(PROP_LOCAL_FILES);
0640: if (localFiles == null) {
0641: if (dmd != null)
0642: localFiles = dmd.usesLocalFiles() ? Boolean.TRUE
0643: : Boolean.FALSE;
0644: else
0645: throw new SQLException(bundle
0646: .getString("EXC_NoDBMetadata")); // NOI18N
0647: properties.put(PROP_LOCAL_FILES, localFiles);
0648: }
0649:
0650: return localFiles.booleanValue();
0651: }
0652:
0653: public int getLocalFiles() {
0654: return getBoolean(PROP_LOCAL_FILES);
0655: }
0656:
0657: public void setLocalFiles(int value) {
0658: setBoolean(PROP_LOCAL_FILES, value);
0659: }
0660:
0661: /**
0662: * Does the database use a file for each table?
0663: * @return true if the database uses a local file for each table
0664: * @exception SQLException if a database access error occurs
0665: */
0666: public boolean usesLocalFilePerTable() throws SQLException {
0667: Boolean filePerTable = (Boolean) properties
0668: .get(PROP_FILE_PER_TABLE);
0669: if (filePerTable == null) {
0670: if (dmd != null)
0671: filePerTable = dmd.usesLocalFilePerTable() ? Boolean.TRUE
0672: : Boolean.FALSE;
0673: else
0674: throw new SQLException(bundle
0675: .getString("EXC_NoDBMetadata")); // NOI18N
0676: properties.put(PROP_FILE_PER_TABLE, filePerTable);
0677: }
0678:
0679: return filePerTable.booleanValue();
0680: }
0681:
0682: public int getLocalFilePerTable() {
0683: return getBoolean(PROP_FILE_PER_TABLE);
0684: }
0685:
0686: public void setLocalFilePerTable(int value) {
0687: setBoolean(PROP_FILE_PER_TABLE, value);
0688: }
0689:
0690: /**
0691: * Does the database treat mixed case unquoted SQL identifiers as
0692: * case sensitive and as a result store them in mixed case?
0693: * @return <code>true</code> if so
0694: */
0695: public boolean supportsMixedCaseIdentifiers() throws SQLException {
0696: Boolean mixedCaseIdentifiers = (Boolean) properties
0697: .get(PROP_MIXEDCASE_IDENTIFIERS);
0698: if (mixedCaseIdentifiers == null) {
0699: if (dmd != null)
0700: mixedCaseIdentifiers = dmd
0701: .supportsMixedCaseIdentifiers() ? Boolean.TRUE
0702: : Boolean.FALSE;
0703: else
0704: throw new SQLException(bundle
0705: .getString("EXC_NoDBMetadata")); // NOI18N
0706: properties.put(PROP_MIXEDCASE_IDENTIFIERS,
0707: mixedCaseIdentifiers);
0708: }
0709:
0710: return mixedCaseIdentifiers.booleanValue();
0711: }
0712:
0713: public int getMixedCaseIdentifiers() {
0714: return getBoolean(PROP_MIXEDCASE_IDENTIFIERS);
0715: }
0716:
0717: public void setMixedCaseIdentifiers(int value) {
0718: setBoolean(PROP_MIXEDCASE_IDENTIFIERS, value);
0719: }
0720:
0721: // identifier store
0722:
0723: public int getIdentifierStore() {
0724: return getInt(PROP_IDENTIFIER_STORE);
0725: }
0726:
0727: public void setIdentifierStore(int value) {
0728: setInt(PROP_IDENTIFIER_STORE, value);
0729: }
0730:
0731: /**
0732: * Does the database treat mixed case unquoted SQL identifiers as
0733: * case insensitive and store them in upper case?
0734: * @return <code>true</code> if so
0735: * @exception SQLException if a database access error occurs
0736: */
0737: public boolean storesUpperCaseIdentifiers() throws SQLException {
0738: Integer identStore = (Integer) properties
0739: .get(PROP_IDENTIFIER_STORE);
0740: if (identStore != null)
0741: return (identStore.intValue() == STORE_UPPERCASE);
0742: if (dmd != null)
0743: return dmd.storesUpperCaseIdentifiers();
0744: else
0745: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0746: }
0747:
0748: /**
0749: * Does the database treat mixed case unquoted SQL identifiers as
0750: * case insensitive and store them in lower case?
0751: * @return <code>true</code> if so
0752: * @exception SQLException if a database access error occurs
0753: */
0754: public boolean storesLowerCaseIdentifiers() throws SQLException {
0755: Integer identStore = (Integer) properties
0756: .get(PROP_IDENTIFIER_STORE);
0757: if (identStore != null)
0758: return (identStore.intValue() == STORE_LOWERCASE);
0759: if (dmd != null)
0760: return dmd.storesLowerCaseIdentifiers();
0761: else
0762: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0763: }
0764:
0765: /**
0766: * Does the database treat mixed case unquoted SQL identifiers as
0767: * case insensitive and store them in mixed case?
0768: * @return <code>true</code> if so
0769: * @exception SQLException if a database access error occurs
0770: */
0771: public boolean storesMixedCaseIdentifiers() throws SQLException {
0772: Integer identStore = (Integer) properties
0773: .get(PROP_IDENTIFIER_STORE);
0774: if (identStore != null)
0775: return (identStore.intValue() == STORE_MIXEDCASE);
0776: if (dmd != null)
0777: return dmd.storesLowerCaseIdentifiers();
0778: else
0779: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0780: }
0781:
0782: /**
0783: * Does the database treat mixed case quoted SQL identifiers as
0784: * case sensitive and as a result store them in mixed case?
0785: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver will always return true.
0786: * @return <code>true</code> if so
0787: * @exception SQLException if a database access error occurs
0788: */
0789: public boolean supportsMixedCaseQuotedIdentifiers()
0790: throws SQLException {
0791: Boolean mixedCaseQuotedIdentifiers = (Boolean) properties
0792: .get(PROP_MIXEDCASE_QUOTED_IDENTIFIERS);
0793: if (mixedCaseQuotedIdentifiers == null) {
0794: if (dmd != null)
0795: mixedCaseQuotedIdentifiers = dmd
0796: .supportsMixedCaseQuotedIdentifiers() ? Boolean.TRUE
0797: : Boolean.FALSE;
0798: else
0799: throw new SQLException(bundle
0800: .getString("EXC_NoDBMetadata")); // NOI18N
0801: properties.put(PROP_MIXEDCASE_QUOTED_IDENTIFIERS,
0802: mixedCaseQuotedIdentifiers);
0803: }
0804:
0805: return mixedCaseQuotedIdentifiers.booleanValue();
0806: }
0807:
0808: public int getMixedCaseQuotedIdentifiers() {
0809: return getBoolean(PROP_MIXEDCASE_QUOTED_IDENTIFIERS);
0810: }
0811:
0812: public void setMixedCaseQuotedIdentifiers(int value) {
0813: setBoolean(PROP_MIXEDCASE_QUOTED_IDENTIFIERS, value);
0814: }
0815:
0816: // quoted store
0817:
0818: public int getQuotedIdentifierStore() {
0819: return getInt(PROP_QUOTED_IDENTS);
0820: }
0821:
0822: public void setQuotedIdentifierStore(int value) {
0823: setInt(PROP_QUOTED_IDENTS, value);
0824: }
0825:
0826: /**
0827: * Does the database treat mixed case quoted SQL identifiers as
0828: * case insensitive and store them in upper case?
0829: * @return <code>true</code> if so
0830: * @exception SQLException if a database access error occurs
0831: */
0832: public boolean storesUpperCaseQuotedIdentifiers()
0833: throws SQLException {
0834: Integer identQuotedStore = (Integer) properties
0835: .get(PROP_QUOTED_IDENTS);
0836: if (identQuotedStore != null)
0837: return (identQuotedStore.intValue() == STORE_UPPERCASE);
0838: if (dmd != null)
0839: return dmd.storesUpperCaseQuotedIdentifiers();
0840: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0841: }
0842:
0843: /**
0844: * Does the database treat mixed case quoted SQL identifiers as
0845: * case insensitive and store them in lower case?
0846: * @return <code>true</code> if so
0847: * @exception SQLException if a database access error occurs
0848: */
0849: public boolean storesLowerCaseQuotedIdentifiers()
0850: throws SQLException {
0851: Integer identQuotedStore = (Integer) properties
0852: .get(PROP_QUOTED_IDENTS);
0853: if (identQuotedStore != null)
0854: return (identQuotedStore.intValue() == STORE_LOWERCASE);
0855: if (dmd != null)
0856: return dmd.storesLowerCaseQuotedIdentifiers();
0857: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0858: }
0859:
0860: /**
0861: * Does the database treat mixed case quoted SQL identifiers as
0862: * case insensitive and store them in mixed case?
0863: * @return <code>true</code> if so
0864: */
0865: public boolean storesMixedCaseQuotedIdentifiers()
0866: throws SQLException {
0867: Integer identQuotedStore = (Integer) properties
0868: .get(PROP_QUOTED_IDENTS);
0869: if (identQuotedStore != null)
0870: return (identQuotedStore.intValue() == STORE_MIXEDCASE);
0871: if (dmd != null)
0872: return dmd.storesMixedCaseQuotedIdentifiers();
0873: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
0874: }
0875:
0876: /**
0877: * What's the string used to quote SQL identifiers?
0878: * This returns a space " " if identifier quoting isn't supported.
0879: * @return the quoting string
0880: * @exception SQLException if a database access error occurs
0881: */
0882: public String getIdentifierQuoteString() throws SQLException {
0883: String identifierQuoteString = (String) properties
0884: .get(PROP_IDENTIFIER_QUOTE);
0885: if (identifierQuoteString == null) {
0886: if (dmd != null)
0887: identifierQuoteString = dmd.getIdentifierQuoteString();
0888: else
0889: return NOT_SET_STRING;
0890: properties
0891: .put(PROP_IDENTIFIER_QUOTE, identifierQuoteString);
0892: }
0893:
0894: return identifierQuoteString;
0895: }
0896:
0897: public void setIdentifierQuoteString(String value) {
0898: setString(PROP_IDENTIFIER_QUOTE, value);
0899: }
0900:
0901: /**
0902: * Gets a comma-separated list of all a database's SQL keywords
0903: * that are NOT also SQL92 keywords.
0904: * @return the list
0905: * @exception SQLException if a database access error occurs
0906: */
0907: public String getSQLKeywords() throws SQLException {
0908: String sqlKeywords = (String) properties.get(PROP_SQL_KEYWORDS);
0909: if (sqlKeywords == null) {
0910: if (dmd != null)
0911: sqlKeywords = dmd.getSQLKeywords();
0912: else
0913: return NOT_SET_STRING;
0914: properties.put(PROP_SQL_KEYWORDS, sqlKeywords);
0915: }
0916:
0917: return sqlKeywords;
0918: }
0919:
0920: public void setSQLKeywords(String value) {
0921: setString(PROP_SQL_KEYWORDS, value);
0922: }
0923:
0924: /**
0925: * Gets a comma-separated list of math functions. These are the
0926: * X/Open CLI math function names used in the JDBC function escape
0927: * clause.
0928: * @return the list
0929: * @exception SQLException if a database access error occurs
0930: */
0931: public String getNumericFunctions() throws SQLException {
0932: String numericFunctions = (String) properties
0933: .get(PROP_NUMERIC_FUNCTIONS);
0934: if (numericFunctions == null) {
0935: if (dmd != null)
0936: numericFunctions = dmd.getNumericFunctions();
0937: else
0938: return NOT_SET_STRING;
0939: properties.put(PROP_NUMERIC_FUNCTIONS, numericFunctions);
0940: }
0941:
0942: return numericFunctions;
0943: }
0944:
0945: public void setNumericFunctions(String value) {
0946: setString(PROP_NUMERIC_FUNCTIONS, value);
0947: }
0948:
0949: /**
0950: * Gets a comma-separated list of string functions. These are the
0951: * X/Open CLI string function names used in the JDBC function escape
0952: * clause.
0953: * @return the list
0954: * @exception SQLException if a database access error occurs
0955: */
0956: public String getStringFunctions() throws SQLException {
0957: String stringFunctions = (String) properties
0958: .get(PROP_STRING_FUNCTIONS);
0959: if (stringFunctions == null) {
0960: if (dmd != null)
0961: stringFunctions = dmd.getStringFunctions();
0962: else
0963: return NOT_SET_STRING;
0964: properties.put(PROP_STRING_FUNCTIONS, stringFunctions);
0965: }
0966:
0967: return stringFunctions;
0968: }
0969:
0970: public void setStringFunctions(String value) {
0971: setString(PROP_STRING_FUNCTIONS, value);
0972: }
0973:
0974: /**
0975: * Gets a comma-separated list of system functions. These are the
0976: * X/Open CLI system function names used in the JDBC function escape
0977: * clause.
0978: * @return the list
0979: * @exception SQLException if a database access error occurs
0980: */
0981: public String getSystemFunctions() throws SQLException {
0982: String systemFunctions = (String) properties
0983: .get(PROP_SYSTEM_FUNCTIONS);
0984: if (systemFunctions == null) {
0985: if (dmd != null)
0986: systemFunctions = dmd.getSystemFunctions();
0987: else
0988: return NOT_SET_STRING;
0989: properties.put(PROP_SYSTEM_FUNCTIONS, systemFunctions);
0990: }
0991:
0992: return systemFunctions;
0993: }
0994:
0995: public void setSystemFunctions(String value) {
0996: setString(PROP_SYSTEM_FUNCTIONS, value);
0997: }
0998:
0999: /**
1000: * Gets a comma-separated list of time and date functions.
1001: * @return the list
1002: * @exception SQLException if a database access error occurs
1003: */
1004: public String getTimeDateFunctions() throws SQLException {
1005: String timeFunctions = (String) properties
1006: .get(PROP_TIME_FUNCTIONS);
1007: if (timeFunctions == null) {
1008: if (dmd != null)
1009: timeFunctions = dmd.getTimeDateFunctions();
1010: else
1011: return NOT_SET_STRING;
1012: properties.put(PROP_TIME_FUNCTIONS, timeFunctions);
1013: }
1014:
1015: return timeFunctions;
1016: }
1017:
1018: public void setTimeDateFunctions(String value) {
1019: setString(PROP_TIME_FUNCTIONS, value);
1020: }
1021:
1022: /**
1023: * Gets the string that can be used to escape wildcard characters.
1024: * This is the string that can be used to escape '_' or '%' in
1025: * the string pattern style catalog search parameters.
1026: * <P>The '_' character represents any single character.
1027: * <P>The '%' character represents any sequence of zero or
1028: * more characters.
1029: * @return the string used to escape wildcard characters
1030: * @exception SQLException if a database access error occurs
1031: */
1032: public String getSearchStringEscape() throws SQLException {
1033: String stringEscape = (String) properties
1034: .get(PROP_STRING_ESCAPE);
1035: if (stringEscape == null) {
1036: if (dmd != null)
1037: stringEscape = dmd.getSearchStringEscape();
1038: else
1039: return NOT_SET_STRING;
1040: properties.put(PROP_STRING_ESCAPE, stringEscape);
1041: }
1042:
1043: return stringEscape;
1044: }
1045:
1046: public void setSearchStringEscape(String value) {
1047: setString(PROP_STRING_ESCAPE, value);
1048: }
1049:
1050: /**
1051: * Gets all the "extra" characters that can be used in unquoted
1052: * identifier names (those beyond a-z, A-Z, 0-9 and _).
1053: * @return the string containing the extra characters
1054: * @exception SQLException if a database access error occurs
1055: */
1056: public String getExtraNameCharacters() throws SQLException {
1057: String extraCharacters = (String) properties
1058: .get(PROP_EXTRA_CHARACTERS);
1059: if (extraCharacters == null) {
1060: if (dmd != null)
1061: extraCharacters = dmd.getExtraNameCharacters();
1062: else
1063: return NOT_SET_STRING;
1064: properties.put(PROP_EXTRA_CHARACTERS, extraCharacters);
1065: }
1066:
1067: return extraCharacters;
1068: }
1069:
1070: public void setExtraNameCharacters(String value) {
1071: setString(PROP_EXTRA_CHARACTERS, value);
1072: }
1073:
1074: /**
1075: * Is "ALTER TABLE" with add column supported?
1076: * @return <code>true</code> if so
1077: */
1078: public boolean supportsAlterTableWithAddColumn()
1079: throws SQLException {
1080: Boolean alterAdd = (Boolean) properties.get(PROP_ALTER_ADD);
1081: if (alterAdd == null) {
1082: if (dmd != null)
1083: alterAdd = dmd.supportsAlterTableWithAddColumn() ? Boolean.TRUE
1084: : Boolean.FALSE;
1085: else
1086: throw new SQLException(bundle
1087: .getString("EXC_NoDBMetadata")); // NOI18N
1088: properties.put(PROP_ALTER_ADD, alterAdd);
1089: }
1090:
1091: return alterAdd.booleanValue();
1092: }
1093:
1094: public int getAlterTableWithAddColumn() {
1095: return getBoolean(PROP_ALTER_ADD);
1096: }
1097:
1098: public void setAlterTableWithAddColumn(int value) {
1099: setBoolean(PROP_ALTER_ADD, value);
1100: }
1101:
1102: /**
1103: * Is "ALTER TABLE" with drop column supported?
1104: * @return <code>true</code> if so
1105: * @exception SQLException if a database access error occurs
1106: */
1107: public boolean supportsAlterTableWithDropColumn()
1108: throws SQLException {
1109: Boolean alterDrop = (Boolean) properties.get(PROP_ALTER_DROP);
1110: if (alterDrop == null) {
1111: if (dmd != null)
1112: alterDrop = dmd.supportsAlterTableWithDropColumn() ? Boolean.TRUE
1113: : Boolean.FALSE;
1114: else
1115: throw new SQLException(bundle
1116: .getString("EXC_NoDBMetadata")); // NOI18N
1117: properties.put(PROP_ALTER_DROP, alterDrop);
1118: }
1119:
1120: return alterDrop.booleanValue();
1121: }
1122:
1123: public int getAlterTableWithDropColumn() {
1124: return getBoolean(PROP_ALTER_DROP);
1125: }
1126:
1127: public void setAlterTableWithDropColumn(int value) {
1128: setBoolean(PROP_ALTER_DROP, value);
1129: }
1130:
1131: /**
1132: * Is column aliasing supported?
1133: * <P>If so, the SQL AS clause can be used to provide names for
1134: * computed columns or to provide alias names for columns as
1135: * required.
1136: * @return <code>true</code> if so
1137: */
1138: public boolean supportsColumnAliasing() throws SQLException {
1139: Boolean columnAliasing = (Boolean) properties
1140: .get(PROP_COLUMN_ALIASING);
1141: if (columnAliasing == null) {
1142: if (dmd != null)
1143: columnAliasing = dmd.supportsColumnAliasing() ? Boolean.TRUE
1144: : Boolean.FALSE;
1145: else
1146: throw new SQLException(bundle
1147: .getString("EXC_NoDBMetadata")); // NOI18N
1148: properties.put(PROP_COLUMN_ALIASING, columnAliasing);
1149: }
1150:
1151: return columnAliasing.booleanValue();
1152: }
1153:
1154: public int getColumnAliasing() {
1155: return getBoolean(PROP_COLUMN_ALIASING);
1156: }
1157:
1158: public void setColumnAliasing(int value) {
1159: setBoolean(PROP_COLUMN_ALIASING, value);
1160: }
1161:
1162: /**
1163: * Are concatenations between NULL and non-NULL values NULL?
1164: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
1165: * @return <code>true</code> if so
1166: */
1167: public boolean nullPlusNonNullIsNull() throws SQLException {
1168: Boolean nullPlusNull = (Boolean) properties
1169: .get(PROP_NULL_PLUS_NULL_IS_NULL);
1170: if (nullPlusNull == null) {
1171: if (dmd != null)
1172: nullPlusNull = dmd.nullPlusNonNullIsNull() ? Boolean.TRUE
1173: : Boolean.FALSE;
1174: else
1175: throw new SQLException(bundle
1176: .getString("EXC_NoDBMetadata")); // NOI18N
1177: properties.put(PROP_NULL_PLUS_NULL_IS_NULL, nullPlusNull);
1178: }
1179:
1180: return nullPlusNull.booleanValue();
1181: }
1182:
1183: public int getNullPlusNonNullIsNull() {
1184: return getBoolean(PROP_NULL_PLUS_NULL_IS_NULL);
1185: }
1186:
1187: public void setNullPlusNonNullIsNull(int value) {
1188: setBoolean(PROP_NULL_PLUS_NULL_IS_NULL, value);
1189: }
1190:
1191: /**
1192: * Is the CONVERT function between SQL types supported?
1193: * @return <code>true</code> if so
1194: * @exception SQLException if a database access error occurs
1195: */
1196: public boolean supportsConvert() throws SQLException {
1197: Boolean supportsConvert = (Boolean) properties
1198: .get(PROP_CONVERT);
1199: if (supportsConvert == null) {
1200: if (dmd != null)
1201: supportsConvert = dmd.supportsConvert() ? Boolean.TRUE
1202: : Boolean.FALSE;
1203: else
1204: throw new SQLException(bundle
1205: .getString("EXC_NoDBMetadata")); // NOI18N
1206: properties.put(PROP_CONVERT, supportsConvert);
1207: }
1208:
1209: return supportsConvert.booleanValue();
1210: }
1211:
1212: public int getConvert() {
1213: return getBoolean(PROP_CONVERT);
1214: }
1215:
1216: public void setConvert(int value) {
1217: setBoolean(PROP_CONVERT, value);
1218: }
1219:
1220: /**
1221: * Is CONVERT between the given SQL types supported?
1222: * @param fromType the type to convert from
1223: * @param toType the type to convert to
1224: * @return <code>true</code> if so
1225: */
1226: public boolean supportsConvert(int fromType, int toType)
1227: throws SQLException {
1228: if (dmd != null)
1229: return dmd.supportsConvert(fromType, toType);
1230: else
1231: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
1232: }
1233:
1234: /**
1235: * Are table correlation names supported?
1236: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
1237: * @return <code>true</code> if so
1238: * @exception SQLException if a database access error occurs
1239: */
1240: public boolean supportsTableCorrelationNames() throws SQLException {
1241: Boolean nameCorrelation = (Boolean) properties
1242: .get(PROP_TABLE_CORRELATION_NAMES);
1243: if (nameCorrelation == null) {
1244: if (dmd != null)
1245: nameCorrelation = dmd.supportsTableCorrelationNames() ? Boolean.TRUE
1246: : Boolean.FALSE;
1247: else
1248: throw new SQLException(bundle
1249: .getString("EXC_NoDBMetadata")); // NOI18N
1250: properties.put(PROP_TABLE_CORRELATION_NAMES,
1251: nameCorrelation);
1252: }
1253:
1254: return nameCorrelation.booleanValue();
1255: }
1256:
1257: public int getTableCorrelationNames() {
1258: return getBoolean(PROP_TABLE_CORRELATION_NAMES);
1259: }
1260:
1261: public void setTableCorrelationNames(int value) {
1262: setBoolean(PROP_TABLE_CORRELATION_NAMES, value);
1263: }
1264:
1265: /**
1266: * If table correlation names are supported, are they restricted
1267: * to be different from the names of the tables?
1268: * @exception SQLException if a database access error occurs
1269: */
1270: public boolean supportsDifferentTableCorrelationNames()
1271: throws SQLException {
1272: Boolean tableCorrelation = (Boolean) properties
1273: .get(PROP_DIFF_TABLE_CORRELATION_NAMES);
1274: if (tableCorrelation == null) {
1275: if (dmd != null)
1276: tableCorrelation = dmd
1277: .supportsDifferentTableCorrelationNames() ? Boolean.TRUE
1278: : Boolean.FALSE;
1279: else
1280: throw new SQLException(bundle
1281: .getString("EXC_NoDBMetadata")); // NOI18N
1282: properties.put(PROP_DIFF_TABLE_CORRELATION_NAMES,
1283: tableCorrelation);
1284: }
1285:
1286: return tableCorrelation.booleanValue();
1287: }
1288:
1289: public int getDifferentTableCorrelationNames() {
1290: return getBoolean(PROP_DIFF_TABLE_CORRELATION_NAMES);
1291: }
1292:
1293: public void setDifferentTableCorrelationNames(int value) {
1294: setBoolean(PROP_DIFF_TABLE_CORRELATION_NAMES, value);
1295: }
1296:
1297: /**
1298: * Are expressions in "ORDER BY" lists supported?
1299: * @return <code>true</code> if so
1300: * @exception SQLException if a database access error occurs
1301: */
1302: public boolean supportsExpressionsInOrderBy() throws SQLException {
1303: Boolean ordering = (Boolean) properties
1304: .get(PROP_EXPRESSIONS_IN_ORDERBY);
1305: if (ordering == null) {
1306: if (dmd != null)
1307: ordering = dmd.supportsExpressionsInOrderBy() ? Boolean.TRUE
1308: : Boolean.FALSE;
1309: else
1310: throw new SQLException(bundle
1311: .getString("EXC_NoDBMetadata")); // NOI18N
1312: properties.put(PROP_EXPRESSIONS_IN_ORDERBY, ordering);
1313: }
1314:
1315: return ordering.booleanValue();
1316: }
1317:
1318: public int getExpressionsInOrderBy() {
1319: return getBoolean(PROP_EXPRESSIONS_IN_ORDERBY);
1320: }
1321:
1322: public void setExpressionsInOrderBy(int value) {
1323: setBoolean(PROP_EXPRESSIONS_IN_ORDERBY, value);
1324: }
1325:
1326: /**
1327: * Can an "ORDER BY" clause use columns not in the SELECT statement?
1328: * @return <code>true</code> if so
1329: * @exception SQLException if a database access error occurs
1330: */
1331: public boolean supportsOrderByUnrelated() throws SQLException {
1332: Boolean unrelatedOrdering = (Boolean) properties
1333: .get(PROP_ORDER_BY_UNRELATED);
1334: if (unrelatedOrdering == null) {
1335: if (dmd != null)
1336: unrelatedOrdering = dmd.supportsOrderByUnrelated() ? Boolean.TRUE
1337: : Boolean.FALSE;
1338: else
1339: throw new SQLException(bundle
1340: .getString("EXC_NoDBMetadata")); // NOI18N
1341: properties.put(PROP_ORDER_BY_UNRELATED, unrelatedOrdering);
1342: }
1343:
1344: return unrelatedOrdering.booleanValue();
1345: }
1346:
1347: public int getOrderByUnrelated() {
1348: return getBoolean(PROP_ORDER_BY_UNRELATED);
1349: }
1350:
1351: public void setOrderByUnrelated(int value) {
1352: setBoolean(PROP_ORDER_BY_UNRELATED, value);
1353: }
1354:
1355: /**
1356: * Is some form of "GROUP BY" clause supported?
1357: * @return <code>true</code> if so
1358: */
1359: public boolean supportsGroupBy() throws SQLException {
1360: Boolean groupBy = (Boolean) properties.get(PROP_GROUP_BY);
1361: if (groupBy == null) {
1362: if (dmd != null)
1363: groupBy = dmd.supportsGroupBy() ? Boolean.TRUE
1364: : Boolean.FALSE;
1365: else
1366: throw new SQLException(bundle
1367: .getString("EXC_NoDBMetadata")); // NOI18N
1368: properties.put(PROP_GROUP_BY, groupBy);
1369: }
1370:
1371: return groupBy.booleanValue();
1372: }
1373:
1374: public int getGroupBy() {
1375: return getBoolean(PROP_GROUP_BY);
1376: }
1377:
1378: public void setGroupBy(int value) {
1379: setBoolean(PROP_GROUP_BY, value);
1380: }
1381:
1382: /**
1383: * Can a "GROUP BY" clause use columns not in the SELECT?
1384: * @return <code>true</code> if so
1385: * @exception SQLException if a database access error occurs
1386: */
1387: public boolean supportsGroupByUnrelated() throws SQLException {
1388: Boolean unrelatedGroupBy = (Boolean) properties
1389: .get(PROP_UNRELATED_GROUP_BY);
1390: if (unrelatedGroupBy == null) {
1391: if (dmd != null)
1392: unrelatedGroupBy = dmd.supportsGroupByUnrelated() ? Boolean.TRUE
1393: : Boolean.FALSE;
1394: else
1395: throw new SQLException(bundle
1396: .getString("EXC_NoDBMetadata")); // NOI18N
1397: properties.put(PROP_UNRELATED_GROUP_BY, unrelatedGroupBy);
1398: }
1399:
1400: return unrelatedGroupBy.booleanValue();
1401: }
1402:
1403: public int getGroupByUnrelated() {
1404: return getBoolean(PROP_UNRELATED_GROUP_BY);
1405: }
1406:
1407: public void setGroupByUnrelated(int value) {
1408: setBoolean(PROP_UNRELATED_GROUP_BY, value);
1409: }
1410:
1411: /**
1412: * Can a "GROUP BY" clause add columns not in the SELECT
1413: * provided it specifies all the columns in the SELECT?
1414: * @return <code>true</code> if so
1415: */
1416: public boolean supportsGroupByBeyondSelect() throws SQLException {
1417: Boolean beyondGroupBy = (Boolean) properties
1418: .get(PROP_BEYOND_GROUP_BY);
1419: if (beyondGroupBy == null) {
1420: if (dmd != null)
1421: beyondGroupBy = dmd.supportsGroupByBeyondSelect() ? Boolean.TRUE
1422: : Boolean.FALSE;
1423: else
1424: throw new SQLException(bundle
1425: .getString("EXC_NoDBMetadata")); // NOI18N
1426: properties.put(PROP_BEYOND_GROUP_BY, beyondGroupBy);
1427: }
1428:
1429: return beyondGroupBy.booleanValue();
1430: }
1431:
1432: public int getGroupByBeyondSelect() {
1433: return getBoolean(PROP_BEYOND_GROUP_BY);
1434: }
1435:
1436: public void setGroupByBeyondSelect(int value) {
1437: setBoolean(PROP_BEYOND_GROUP_BY, value);
1438: }
1439:
1440: /**
1441: * Is the escape character in "LIKE" clauses supported?
1442: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
1443: * @return <code>true</code> if so
1444: * @exception SQLException if a database access error occurs
1445: */
1446: public boolean supportsLikeEscapeClause() throws SQLException {
1447: Boolean escapeLike = (Boolean) properties.get(PROP_ESCAPE_LIKE);
1448: if (escapeLike == null) {
1449: if (dmd != null)
1450: escapeLike = dmd.supportsLikeEscapeClause() ? Boolean.TRUE
1451: : Boolean.FALSE;
1452: else
1453: throw new SQLException(bundle
1454: .getString("EXC_NoDBMetadata")); // NOI18N
1455: properties.put(PROP_ESCAPE_LIKE, escapeLike);
1456: }
1457:
1458: return escapeLike.booleanValue();
1459: }
1460:
1461: public int getLikeEscapeClause() {
1462: return getBoolean(PROP_ESCAPE_LIKE);
1463: }
1464:
1465: public void setLikeEscapeClause(int value) {
1466: setBoolean(PROP_ESCAPE_LIKE, value);
1467: }
1468:
1469: /**
1470: * Are multiple ResultSets from a single execute supported?
1471: * @return <code>true</code> if so
1472: * @exception SQLException if a database access error occurs
1473: */
1474: public boolean supportsMultipleResultSets() throws SQLException {
1475: Boolean multipleResultSets = (Boolean) properties
1476: .get(PROP_MULTIPLE_RS);
1477: if (multipleResultSets == null) {
1478: if (dmd != null)
1479: multipleResultSets = dmd.supportsMultipleResultSets() ? Boolean.TRUE
1480: : Boolean.FALSE;
1481: else
1482: throw new SQLException(bundle
1483: .getString("EXC_NoDBMetadata")); // NOI18N
1484: properties.put(PROP_MULTIPLE_RS, multipleResultSets);
1485: }
1486:
1487: return multipleResultSets.booleanValue();
1488: }
1489:
1490: public int getMultipleResultSets() {
1491: return getBoolean(PROP_MULTIPLE_RS);
1492: }
1493:
1494: public void setMultipleResultSets(int value) {
1495: setBoolean(PROP_MULTIPLE_RS, value);
1496: }
1497:
1498: /**
1499: * Can we have multiple transactions open at once (on different
1500: * connections)?
1501: * @return <code>true</code> if so
1502: * @exception SQLException if a database access error occurs
1503: */
1504: public boolean supportsMultipleTransactions() throws SQLException {
1505: Boolean multipleTransactions = (Boolean) properties
1506: .get(PROP_MULTIPLE_TRANSACTIONS);
1507: if (multipleTransactions == null) {
1508: if (dmd != null)
1509: multipleTransactions = dmd
1510: .supportsMultipleTransactions() ? Boolean.TRUE
1511: : Boolean.FALSE;
1512: else
1513: throw new SQLException(bundle
1514: .getString("EXC_NoDBMetadata")); // NOI18N
1515: properties.put(PROP_MULTIPLE_TRANSACTIONS,
1516: multipleTransactions);
1517: }
1518:
1519: return multipleTransactions.booleanValue();
1520: }
1521:
1522: public int getMultipleTransactions() {
1523: return getBoolean(PROP_MULTIPLE_TRANSACTIONS);
1524: }
1525:
1526: public void setMultipleTransactions(int value) {
1527: setBoolean(PROP_MULTIPLE_TRANSACTIONS, value);
1528: }
1529:
1530: /**
1531: * Can columns be defined as non-nullable?
1532: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
1533: * @exception SQLException if a database access error occurs
1534: */
1535: public boolean supportsNonNullableColumns() throws SQLException {
1536: Boolean nunNullableColumns = (Boolean) properties
1537: .get(PROP_NON_NULL_COLUMNSS);
1538: if (nunNullableColumns == null) {
1539: if (dmd != null)
1540: nunNullableColumns = dmd.supportsNonNullableColumns() ? Boolean.TRUE
1541: : Boolean.FALSE;
1542: else
1543: throw new SQLException(bundle
1544: .getString("EXC_NoDBMetadata")); // NOI18N
1545: properties.put(PROP_NON_NULL_COLUMNSS, nunNullableColumns);
1546: }
1547:
1548: return nunNullableColumns.booleanValue();
1549: }
1550:
1551: public int getNonNullableColumns() {
1552: return getBoolean(PROP_NON_NULL_COLUMNSS);
1553: }
1554:
1555: public void setNonNullableColumns(int value) {
1556: setBoolean(PROP_NON_NULL_COLUMNSS, value);
1557: }
1558:
1559: /**
1560: * Is the ODBC Minimum SQL grammar supported?
1561: * All JDBC Compliant<sup><font size=-2>TM</font></sup> drivers must return true.
1562: * @return <code>true</code> if so
1563: * @exception SQLException if a database access error occurs
1564: */
1565: public boolean supportsMinimumSQLGrammar() throws SQLException {
1566: Boolean minimumSQLGrammar = (Boolean) properties
1567: .get(PROP_MINUMUM_SQL_GRAMMAR);
1568: if (minimumSQLGrammar == null) {
1569: if (dmd != null)
1570: minimumSQLGrammar = dmd.supportsMinimumSQLGrammar() ? Boolean.TRUE
1571: : Boolean.FALSE;
1572: else
1573: throw new SQLException(bundle
1574: .getString("EXC_NoDBMetadata")); // NOI18N
1575: properties.put(PROP_MINUMUM_SQL_GRAMMAR, minimumSQLGrammar);
1576: }
1577:
1578: return minimumSQLGrammar.booleanValue();
1579: }
1580:
1581: public int getMinimumSQLGrammar() {
1582: return getBoolean(PROP_MINUMUM_SQL_GRAMMAR);
1583: }
1584:
1585: public void setMinimumSQLGrammar(int value) {
1586: setBoolean(PROP_MINUMUM_SQL_GRAMMAR, value);
1587: }
1588:
1589: /**
1590: * Is the ODBC Core SQL grammar supported?
1591: * @return <code>true</code> if so
1592: * @exception SQLException if a database access error occurs
1593: */
1594: public boolean supportsCoreSQLGrammar() throws SQLException {
1595: Boolean coreSQLGrammar = (Boolean) properties
1596: .get(PROP_CORE_SQL_GRAMMAR);
1597: if (coreSQLGrammar == null) {
1598: if (dmd != null)
1599: coreSQLGrammar = dmd.supportsCoreSQLGrammar() ? Boolean.TRUE
1600: : Boolean.FALSE;
1601: else
1602: throw new SQLException(bundle
1603: .getString("EXC_NoDBMetadata")); // NOI18N
1604: properties.put(PROP_CORE_SQL_GRAMMAR, coreSQLGrammar);
1605: }
1606:
1607: return coreSQLGrammar.booleanValue();
1608: }
1609:
1610: public int getCoreSQLGrammar() {
1611: return getBoolean(PROP_CORE_SQL_GRAMMAR);
1612: }
1613:
1614: public void setCoreSQLGrammar(int value) {
1615: setBoolean(PROP_CORE_SQL_GRAMMAR, value);
1616: }
1617:
1618: /**
1619: * Is the ODBC Extended SQL grammar supported?
1620: * @return <code>true</code> if so
1621: */
1622: public boolean supportsExtendedSQLGrammar() throws SQLException {
1623: Boolean extendedSQLGrammar = (Boolean) properties
1624: .get(PROP_EXTENDED_SQL_GRAMMAR);
1625: if (extendedSQLGrammar == null) {
1626: if (dmd != null)
1627: extendedSQLGrammar = dmd.supportsExtendedSQLGrammar() ? Boolean.TRUE
1628: : Boolean.FALSE;
1629: else
1630: throw new SQLException(bundle
1631: .getString("EXC_NoDBMetadata")); // NOI18N
1632: properties.put(PROP_EXTENDED_SQL_GRAMMAR,
1633: extendedSQLGrammar);
1634: }
1635:
1636: return extendedSQLGrammar.booleanValue();
1637: }
1638:
1639: public int getExtendedSQLGrammar() {
1640: return getBoolean(PROP_EXTENDED_SQL_GRAMMAR);
1641: }
1642:
1643: public void setExtendedSQLGrammar(int value) {
1644: setBoolean(PROP_EXTENDED_SQL_GRAMMAR, value);
1645: }
1646:
1647: /**
1648: * Is the ANSI92 entry level SQL grammar supported?
1649: * All JDBC Compliant<sup><font size=-2>TM</font></sup> drivers must return true.
1650: * @return <code>true</code> if so
1651: * @exception SQLException if a database access error occurs
1652: */
1653: public boolean supportsANSI92EntryLevelSQL() throws SQLException {
1654: Boolean ansiSQLGrammar = (Boolean) properties
1655: .get(PROP_ANSI_SQL_GRAMMAR);
1656: if (ansiSQLGrammar == null) {
1657: if (dmd != null)
1658: ansiSQLGrammar = dmd.supportsANSI92EntryLevelSQL() ? Boolean.TRUE
1659: : Boolean.FALSE;
1660: else
1661: throw new SQLException(bundle
1662: .getString("EXC_NoDBMetadata")); // NOI18N
1663: properties.put(PROP_ANSI_SQL_GRAMMAR, ansiSQLGrammar);
1664: }
1665:
1666: return ansiSQLGrammar.booleanValue();
1667: }
1668:
1669: public int getANSI92EntryLevelSQL() {
1670: return getBoolean(PROP_ANSI_SQL_GRAMMAR);
1671: }
1672:
1673: public void setANSI92EntryLevelSQL(int value) {
1674: setBoolean(PROP_ANSI_SQL_GRAMMAR, value);
1675: }
1676:
1677: /**
1678: * Is the ANSI92 intermediate SQL grammar supported?
1679: * @exception SQLException if a database access error occurs
1680: */
1681: public boolean supportsANSI92IntermediateSQL() throws SQLException {
1682: Boolean ansiInterSQLGrammar = (Boolean) properties
1683: .get(PROP_INTERMEDIATE_SQL_GRAMMAR);
1684: if (ansiInterSQLGrammar == null) {
1685: if (dmd != null)
1686: ansiInterSQLGrammar = dmd
1687: .supportsANSI92IntermediateSQL() ? Boolean.TRUE
1688: : Boolean.FALSE;
1689: else
1690: throw new SQLException(bundle
1691: .getString("EXC_NoDBMetadata")); // NOI18N
1692: properties.put(PROP_INTERMEDIATE_SQL_GRAMMAR,
1693: ansiInterSQLGrammar);
1694: }
1695:
1696: return ansiInterSQLGrammar.booleanValue();
1697: }
1698:
1699: public int getANSI92IntermediateSQL() {
1700: return getBoolean(PROP_INTERMEDIATE_SQL_GRAMMAR);
1701: }
1702:
1703: public void setANSI92IntermediateSQL(int value) {
1704: setBoolean(PROP_INTERMEDIATE_SQL_GRAMMAR, value);
1705: }
1706:
1707: /**
1708: * Is the ANSI92 full SQL grammar supported?
1709: * @return <code>true</code> if so
1710: */
1711: public boolean supportsANSI92FullSQL() throws SQLException {
1712: Boolean ansiFullSQLGrammar = (Boolean) properties
1713: .get(PROP_FULL_SQL_GRAMMAR);
1714: if (ansiFullSQLGrammar == null) {
1715: if (dmd != null)
1716: ansiFullSQLGrammar = dmd.supportsANSI92FullSQL() ? Boolean.TRUE
1717: : Boolean.FALSE;
1718: else
1719: throw new SQLException(bundle
1720: .getString("EXC_NoDBMetadata")); // NOI18N
1721: properties.put(PROP_FULL_SQL_GRAMMAR, ansiFullSQLGrammar);
1722: }
1723:
1724: return ansiFullSQLGrammar.booleanValue();
1725: }
1726:
1727: public int getANSI92FullSQL() {
1728: return getBoolean(PROP_FULL_SQL_GRAMMAR);
1729: }
1730:
1731: public void setANSI92FullSQL(int value) {
1732: setBoolean(PROP_FULL_SQL_GRAMMAR, value);
1733: }
1734:
1735: /**
1736: * Is the SQL Integrity Enhancement Facility supported?
1737: * @return <code>true</code> if so
1738: * @exception SQLException if a database access error occurs
1739: */
1740: public boolean supportsIntegrityEnhancementFacility()
1741: throws SQLException {
1742: Boolean integrityEnh = (Boolean) properties
1743: .get(PROP_INTEGRITY_ENHANCEMENT);
1744: if (integrityEnh == null) {
1745: if (dmd != null)
1746: integrityEnh = dmd
1747: .supportsIntegrityEnhancementFacility() ? Boolean.TRUE
1748: : Boolean.FALSE;
1749: else
1750: throw new SQLException(bundle
1751: .getString("EXC_NoDBMetadata")); // NOI18N
1752: properties.put(PROP_INTEGRITY_ENHANCEMENT, integrityEnh);
1753: }
1754:
1755: return integrityEnh.booleanValue();
1756: }
1757:
1758: public int getIntegrityEnhancementFacility() {
1759: return getBoolean(PROP_INTEGRITY_ENHANCEMENT);
1760: }
1761:
1762: public void setIntegrityEnhancementFacility(int value) {
1763: setBoolean(PROP_INTEGRITY_ENHANCEMENT, value);
1764: }
1765:
1766: /**
1767: * Is some form of outer join supported?
1768: * @return <code>true</code> if so
1769: * @exception SQLException if a database access error occurs
1770: */
1771: public boolean supportsOuterJoins() throws SQLException {
1772: Boolean outerJoins = (Boolean) properties.get(PROP_OUTER_JOINS);
1773: if (outerJoins == null) {
1774: if (dmd != null)
1775: outerJoins = dmd.supportsOuterJoins() ? Boolean.TRUE
1776: : Boolean.FALSE;
1777: else
1778: throw new SQLException(bundle
1779: .getString("EXC_NoDBMetadata")); // NOI18N
1780: properties.put(PROP_OUTER_JOINS, outerJoins);
1781: }
1782:
1783: return outerJoins.booleanValue();
1784: }
1785:
1786: public int getOuterJoins() {
1787: return getBoolean(PROP_OUTER_JOINS);
1788: }
1789:
1790: public void setOuterJoins(int value) {
1791: setBoolean(PROP_OUTER_JOINS, value);
1792: }
1793:
1794: /**
1795: * Are full nested outer joins supported?
1796: * @return <code>true</code> if so
1797: * @exception SQLException if a database access error occurs
1798: */
1799: public boolean supportsFullOuterJoins() throws SQLException {
1800: Boolean fullOuterJoins = (Boolean) properties
1801: .get(PROP_FULL_OUTER_JOINS);
1802: if (fullOuterJoins == null) {
1803: if (dmd != null)
1804: fullOuterJoins = dmd.supportsFullOuterJoins() ? Boolean.TRUE
1805: : Boolean.FALSE;
1806: else
1807: throw new SQLException(bundle
1808: .getString("EXC_NoDBMetadata")); // NOI18N
1809: properties.put(PROP_FULL_OUTER_JOINS, fullOuterJoins);
1810: }
1811:
1812: return fullOuterJoins.booleanValue();
1813: }
1814:
1815: public int getFullOuterJoins() {
1816: return getBoolean(PROP_FULL_OUTER_JOINS);
1817: }
1818:
1819: public void setFullOuterJoins(int value) {
1820: setBoolean(PROP_FULL_OUTER_JOINS, value);
1821: }
1822:
1823: /**
1824: * Is there limited support for outer joins? (This will be true
1825: * if supportFullOuterJoins is true.)
1826: * @return <code>true</code> if so
1827: * @exception SQLException if a database access error occurs
1828: */
1829: public boolean supportsLimitedOuterJoins() throws SQLException {
1830: Boolean limiterOuterJoins = (Boolean) properties
1831: .get(PROP_LIMITED_OUTER_JOINS);
1832: if (limiterOuterJoins == null) {
1833: if (dmd != null)
1834: limiterOuterJoins = dmd.supportsLimitedOuterJoins() ? Boolean.TRUE
1835: : Boolean.FALSE;
1836: else
1837: throw new SQLException(bundle
1838: .getString("EXC_NoDBMetadata")); // NOI18N
1839: properties.put(PROP_LIMITED_OUTER_JOINS, limiterOuterJoins);
1840: }
1841:
1842: return limiterOuterJoins.booleanValue();
1843: }
1844:
1845: public int getLimitedOuterJoins() {
1846: return getBoolean(PROP_LIMITED_OUTER_JOINS);
1847: }
1848:
1849: public void setLimitedOuterJoins(int value) {
1850: setBoolean(PROP_LIMITED_OUTER_JOINS, value);
1851: }
1852:
1853: /**
1854: * What's the database vendor's preferred term for "schema"?
1855: *
1856: * @return the vendor term
1857: * @exception SQLException if a database access error occurs
1858: */
1859: public String getSchemaTerm() throws SQLException {
1860: String schemaTerm = (String) properties.get(PROP_SCHEMA_TERM);
1861: if (schemaTerm == null) {
1862: if (dmd != null)
1863: schemaTerm = dmd.getSchemaTerm();
1864: else
1865: return NOT_SET_STRING;
1866: properties.put(PROP_SCHEMA_TERM, schemaTerm);
1867: }
1868:
1869: return schemaTerm;
1870: }
1871:
1872: public void setSchemaTerm(String value) {
1873: setString(PROP_SCHEMA_TERM, value);
1874: }
1875:
1876: /**
1877: * What's the database vendor's preferred term for "procedure"?
1878: *
1879: * @return the vendor term
1880: * @exception SQLException if a database access error occurs
1881: */
1882: public String getProcedureTerm() throws SQLException {
1883: String procedureTerm = (String) properties
1884: .get(PROP_PROCEDURE_TERM);
1885: if (procedureTerm == null) {
1886: if (dmd != null)
1887: procedureTerm = dmd.getProcedureTerm();
1888: else
1889: return NOT_SET_STRING;
1890: properties.put(PROP_PROCEDURE_TERM, procedureTerm);
1891: }
1892:
1893: return procedureTerm;
1894: }
1895:
1896: public void setProcedureTerm(String value) {
1897: setString(PROP_PROCEDURE_TERM, value);
1898: }
1899:
1900: /**
1901: * What's the database vendor's preferred term for "catalog"?
1902: *
1903: * @return the vendor term
1904: * @exception SQLException if a database access error occurs
1905: */
1906: public String getCatalogTerm() throws SQLException {
1907: String catalogTerm = (String) properties.get(PROP_CATALOG_TERM);
1908: if (catalogTerm == null) {
1909: if (dmd != null)
1910: catalogTerm = dmd.getCatalogTerm();
1911: else
1912: return NOT_SET_STRING;
1913: properties.put(PROP_CATALOG_TERM, catalogTerm);
1914: }
1915:
1916: return catalogTerm;
1917: }
1918:
1919: public void setCatalogTerm(String value) {
1920: setString(PROP_CATALOG_TERM, value);
1921: }
1922:
1923: /**
1924: * Does a catalog appear at the start of a qualified table name?
1925: * (Otherwise it appears at the end)
1926: * @return true if it appears at the start
1927: * @exception SQLException if a database access error occurs
1928: */
1929:
1930: public boolean isCatalogAtStart() throws SQLException {
1931: Boolean catalogAtStart = (Boolean) properties
1932: .get(PROP_CATALOG_AT_START);
1933: if (catalogAtStart == null) {
1934: if (dmd != null)
1935: catalogAtStart = dmd.isCatalogAtStart() ? Boolean.TRUE
1936: : Boolean.FALSE;
1937: else
1938: throw new SQLException(bundle
1939: .getString("EXC_NoDBMetadata")); // NOI18N
1940: properties.put(PROP_CATALOG_AT_START, catalogAtStart);
1941: }
1942:
1943: return catalogAtStart.booleanValue();
1944: }
1945:
1946: // public int getCatalogAtStart() {
1947: public int getcatalogAtStart() {
1948: return getBoolean(PROP_CATALOG_AT_START);
1949: }
1950:
1951: // public void setCatalogAtStart(int value) {
1952: public void setcatalogAtStart(int value) {
1953: setBoolean(PROP_CATALOG_AT_START, value);
1954: }
1955:
1956: /**
1957: * What's the separator between catalog and table name?
1958: * @return the separator string
1959: * @exception SQLException if a database access error occurs
1960: */
1961: public String getCatalogSeparator() throws SQLException {
1962: String catalogSeparator = (String) properties
1963: .get(PROP_CATALOGS_SEPARATOR);
1964: if (catalogSeparator == null) {
1965: if (dmd != null)
1966: catalogSeparator = dmd.getCatalogSeparator();
1967: else
1968: return NOT_SET_STRING;
1969: properties.put(PROP_CATALOGS_SEPARATOR, catalogSeparator);
1970: }
1971:
1972: return catalogSeparator;
1973: }
1974:
1975: public void setCatalogSeparator(String value) {
1976: setString(PROP_CATALOGS_SEPARATOR, value);
1977: }
1978:
1979: /**
1980: * Can a schema name be used in a data manipulation statement?
1981: * @return <code>true</code> if so
1982: * @exception SQLException if a database access error occurs
1983: */
1984: public boolean supportsSchemasInDataManipulation()
1985: throws SQLException {
1986: Boolean schemasInDM = (Boolean) properties
1987: .get(PROP_SCHEMAS_IN_DML);
1988: if (schemasInDM == null) {
1989: if (dmd != null)
1990: schemasInDM = dmd.supportsSchemasInDataManipulation() ? Boolean.TRUE
1991: : Boolean.FALSE;
1992: else
1993: throw new SQLException(bundle
1994: .getString("EXC_NoDBMetadata")); // NOI18N
1995: properties.put(PROP_SCHEMAS_IN_DML, schemasInDM);
1996: }
1997:
1998: return schemasInDM.booleanValue();
1999: }
2000:
2001: public int getSchemasInDataManipulation() {
2002: return getBoolean(PROP_SCHEMAS_IN_DML);
2003: }
2004:
2005: public void setSchemasInDataManipulation(int value) {
2006: setBoolean(PROP_SCHEMAS_IN_DML, value);
2007: }
2008:
2009: /**
2010: * Can a schema name be used in a procedure call statement?
2011: * @return <code>true</code> if so
2012: * @exception SQLException if a database access error occurs
2013: */
2014: public boolean supportsSchemasInProcedureCalls()
2015: throws SQLException {
2016: Boolean schemasInProcedureCalls = (Boolean) properties
2017: .get(PROP_SCHEMAS_IN_PROCEDURE_CALL);
2018: if (schemasInProcedureCalls == null) {
2019: if (dmd != null)
2020: schemasInProcedureCalls = dmd
2021: .supportsSchemasInProcedureCalls() ? Boolean.TRUE
2022: : Boolean.FALSE;
2023: else
2024: throw new SQLException(bundle
2025: .getString("EXC_NoDBMetadata")); // NOI18N
2026: properties.put(PROP_SCHEMAS_IN_PROCEDURE_CALL,
2027: schemasInProcedureCalls);
2028: }
2029:
2030: return schemasInProcedureCalls.booleanValue();
2031: }
2032:
2033: public int getSchemasInProcedureCalls() {
2034: return getBoolean(PROP_SCHEMAS_IN_PROCEDURE_CALL);
2035: }
2036:
2037: public void setSchemasInProcedureCalls(int value) {
2038: setBoolean(PROP_SCHEMAS_IN_PROCEDURE_CALL, value);
2039: }
2040:
2041: /**
2042: * Can a schema name be used in a table definition statement?
2043: * @return <code>true</code> if so
2044: * @exception SQLException if a database access error occurs
2045: */
2046: public boolean supportsSchemasInTableDefinitions()
2047: throws SQLException {
2048: Boolean schemasInTable = (Boolean) properties
2049: .get(PROP_SCHEMAS_IN_TABLE_DEFINITION);
2050: if (schemasInTable == null) {
2051: if (dmd != null)
2052: schemasInTable = dmd
2053: .supportsSchemasInTableDefinitions() ? Boolean.TRUE
2054: : Boolean.FALSE;
2055: else
2056: throw new SQLException(bundle
2057: .getString("EXC_NoDBMetadata")); // NOI18N
2058: properties.put(PROP_SCHEMAS_IN_TABLE_DEFINITION,
2059: schemasInTable);
2060: }
2061:
2062: return schemasInTable.booleanValue();
2063: }
2064:
2065: public int getSchemasInTableDefinitions() {
2066: return getBoolean(PROP_SCHEMAS_IN_TABLE_DEFINITION);
2067: }
2068:
2069: public void setSchemasInTableDefinitions(int value) {
2070: setBoolean(PROP_SCHEMAS_IN_TABLE_DEFINITION, value);
2071: }
2072:
2073: /**
2074: * Can a schema name be used in an index definition statement?
2075: * @return <code>true</code> if so
2076: * @exception SQLException if a database access error occurs
2077: */
2078: public boolean supportsSchemasInIndexDefinitions()
2079: throws SQLException {
2080: Boolean schemasInIndex = (Boolean) properties
2081: .get(PROP_SCHEMAS_IN_INDEX);
2082: if (schemasInIndex == null) {
2083: if (dmd != null)
2084: schemasInIndex = dmd
2085: .supportsSchemasInIndexDefinitions() ? Boolean.TRUE
2086: : Boolean.FALSE;
2087: else
2088: throw new SQLException(bundle
2089: .getString("EXC_NoDBMetadata")); // NOI18N
2090: properties.put(PROP_SCHEMAS_IN_INDEX, schemasInIndex);
2091: }
2092:
2093: return schemasInIndex.booleanValue();
2094: }
2095:
2096: public int getSchemasInIndexDefinitions() {
2097: return getBoolean(PROP_SCHEMAS_IN_INDEX);
2098: }
2099:
2100: public void setSchemasInIndexDefinitions(int value) {
2101: setBoolean(PROP_SCHEMAS_IN_INDEX, value);
2102: }
2103:
2104: /**
2105: * Can a schema name be used in a privilege definition statement?
2106: * @return <code>true</code> if so
2107: * @exception SQLException if a database access error occurs
2108: */
2109: public boolean supportsSchemasInPrivilegeDefinitions()
2110: throws SQLException {
2111: Boolean schemasInPriv = (Boolean) properties
2112: .get(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION);
2113: if (schemasInPriv == null) {
2114: if (dmd != null)
2115: schemasInPriv = dmd
2116: .supportsSchemasInPrivilegeDefinitions() ? Boolean.TRUE
2117: : Boolean.FALSE;
2118: else
2119: throw new SQLException(bundle
2120: .getString("EXC_NoDBMetadata")); // NOI18N
2121: properties.put(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION,
2122: schemasInPriv);
2123: }
2124:
2125: return schemasInPriv.booleanValue();
2126: }
2127:
2128: public int getSchemasInPrivilegeDefinitions() {
2129: return getBoolean(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION);
2130: }
2131:
2132: public void setSchemasInPrivilegeDefinitions(int value) {
2133: setBoolean(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION, value);
2134: }
2135:
2136: /**
2137: * Can a catalog name be used in a data manipulation statement?
2138: * @return <code>true</code> if so
2139: * @exception SQLException if a database access error occurs
2140: */
2141: public boolean supportsCatalogsInDataManipulation()
2142: throws SQLException {
2143: Boolean catalogInDM = (Boolean) properties
2144: .get(PROP_CATALOGS_IN_DML);
2145: if (catalogInDM == null) {
2146: if (dmd != null)
2147: catalogInDM = dmd.supportsCatalogsInDataManipulation() ? Boolean.TRUE
2148: : Boolean.FALSE;
2149: else
2150: throw new SQLException(bundle
2151: .getString("EXC_NoDBMetadata")); // NOI18N
2152: properties.put(PROP_CATALOGS_IN_DML, catalogInDM);
2153: }
2154:
2155: return catalogInDM.booleanValue();
2156: }
2157:
2158: public int getCatalogsInDataManipulation() {
2159: return getBoolean(PROP_CATALOGS_IN_DML);
2160: }
2161:
2162: public void setCatalogsInDataManipulation(int value) {
2163: setBoolean(PROP_CATALOGS_IN_DML, value);
2164: }
2165:
2166: /**
2167: * Can a catalog name be used in a procedure call statement?
2168: * @return <code>true</code> if so
2169: * @exception SQLException if a database access error occurs
2170: */
2171: public boolean supportsCatalogsInProcedureCalls()
2172: throws SQLException {
2173: Boolean catalogInProc = (Boolean) properties
2174: .get(PROP_CATALOGS_IN_PROCEDURE_CALL);
2175: if (catalogInProc == null) {
2176: if (dmd != null)
2177: catalogInProc = dmd.supportsCatalogsInProcedureCalls() ? Boolean.TRUE
2178: : Boolean.FALSE;
2179: else
2180: throw new SQLException(bundle
2181: .getString("EXC_NoDBMetadata")); // NOI18N
2182: properties.put(PROP_CATALOGS_IN_PROCEDURE_CALL,
2183: catalogInProc);
2184: }
2185:
2186: return catalogInProc.booleanValue();
2187: }
2188:
2189: public int getCatalogsInProcedureCalls() {
2190: return getBoolean(PROP_CATALOGS_IN_PROCEDURE_CALL);
2191: }
2192:
2193: public void setCatalogsInProcedureCalls(int value) {
2194: setBoolean(PROP_CATALOGS_IN_PROCEDURE_CALL, value);
2195: }
2196:
2197: /**
2198: * Can a catalog name be used in a table definition statement?
2199: * @return <code>true</code> if so
2200: * @exception SQLException if a database access error occurs
2201: */
2202: public boolean supportsCatalogsInTableDefinitions()
2203: throws SQLException {
2204: Boolean catalogInTable = (Boolean) properties
2205: .get(PROP_CATALOGS_IN_TABLE_DEFINITION);
2206: if (catalogInTable == null) {
2207: if (dmd != null)
2208: catalogInTable = dmd
2209: .supportsCatalogsInTableDefinitions() ? Boolean.TRUE
2210: : Boolean.FALSE;
2211: else
2212: throw new SQLException(bundle
2213: .getString("EXC_NoDBMetadata")); // NOI18N
2214: properties.put(PROP_CATALOGS_IN_TABLE_DEFINITION,
2215: catalogInTable);
2216: }
2217:
2218: return catalogInTable.booleanValue();
2219: }
2220:
2221: public int getCatalogsInTableDefinitions() {
2222: return getBoolean(PROP_CATALOGS_IN_TABLE_DEFINITION);
2223: }
2224:
2225: public void setCatalogsInTableDefinitions(int value) {
2226: setBoolean(PROP_CATALOGS_IN_TABLE_DEFINITION, value);
2227: }
2228:
2229: /**
2230: * Can a catalog name be used in an index definition statement?
2231: * @return <code>true</code> if so
2232: * @exception SQLException if a database access error occurs
2233: */
2234: public boolean supportsCatalogsInIndexDefinitions()
2235: throws SQLException {
2236: Boolean catalogInIndex = (Boolean) properties
2237: .get(PROP_CATALOGS_IN_INDEX);
2238: if (catalogInIndex == null) {
2239: if (dmd != null)
2240: catalogInIndex = dmd
2241: .supportsCatalogsInIndexDefinitions() ? Boolean.TRUE
2242: : Boolean.FALSE;
2243: else
2244: throw new SQLException(bundle
2245: .getString("EXC_NoDBMetadata")); // NOI18N
2246: properties.put(PROP_CATALOGS_IN_INDEX, catalogInIndex);
2247: }
2248:
2249: return catalogInIndex.booleanValue();
2250: }
2251:
2252: public int getCatalogsInIndexDefinitions() {
2253: return getBoolean(PROP_CATALOGS_IN_INDEX);
2254: }
2255:
2256: public void setCatalogsInIndexDefinitions(int value) {
2257: setBoolean(PROP_CATALOGS_IN_INDEX, value);
2258: }
2259:
2260: /**
2261: * Can a catalog name be used in a privilege definition statement?
2262: * @return <code>true</code> if so
2263: * @exception SQLException if a database access error occurs
2264: */
2265: public boolean supportsCatalogsInPrivilegeDefinitions()
2266: throws SQLException {
2267: Boolean catalogInPriv = (Boolean) properties
2268: .get(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION);
2269: if (catalogInPriv == null) {
2270: if (dmd != null)
2271: catalogInPriv = dmd
2272: .supportsCatalogsInPrivilegeDefinitions() ? Boolean.TRUE
2273: : Boolean.FALSE;
2274: else
2275: throw new SQLException(bundle
2276: .getString("EXC_NoDBMetadata")); // NOI18N
2277: properties.put(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION,
2278: catalogInPriv);
2279: }
2280:
2281: return catalogInPriv.booleanValue();
2282: }
2283:
2284: public int getCatalogsInPrivilegeDefinitions() {
2285: return getBoolean(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION);
2286: }
2287:
2288: public void setCatalogsInPrivilegeDefinitions(int value) {
2289: setBoolean(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION, value);
2290: }
2291:
2292: /**
2293: * Is positioned DELETE supported?
2294: * @return <code>true</code> if so
2295: * @exception SQLException if a database access error occurs
2296: */
2297: public boolean supportsPositionedDelete() throws SQLException {
2298: Boolean posDelete = (Boolean) properties
2299: .get(PROP_POSITIONED_DELETE);
2300: if (posDelete == null) {
2301: if (dmd != null)
2302: posDelete = dmd.supportsPositionedDelete() ? Boolean.TRUE
2303: : Boolean.FALSE;
2304: else
2305: throw new SQLException(bundle
2306: .getString("EXC_NoDBMetadata")); // NOI18N
2307: properties.put(PROP_POSITIONED_DELETE, posDelete);
2308: }
2309:
2310: return posDelete.booleanValue();
2311: }
2312:
2313: public int getPositionedDelete() {
2314: return getBoolean(PROP_POSITIONED_DELETE);
2315: }
2316:
2317: public void setPositionedDelete(int value) {
2318: setBoolean(PROP_POSITIONED_DELETE, value);
2319: }
2320:
2321: /**
2322: * Is positioned UPDATE supported?
2323: * @return <code>true</code> if so
2324: * @exception SQLException if a database access error occurs
2325: */
2326: public boolean supportsPositionedUpdate() throws SQLException {
2327: Boolean posUpdate = (Boolean) properties
2328: .get(PROP_POSITIONED_UPDATE);
2329: if (posUpdate == null) {
2330: if (dmd != null)
2331: posUpdate = dmd.supportsPositionedUpdate() ? Boolean.TRUE
2332: : Boolean.FALSE;
2333: else
2334: throw new SQLException(bundle
2335: .getString("EXC_NoDBMetadata")); // NOI18N
2336: properties.put(PROP_POSITIONED_UPDATE, posUpdate);
2337: }
2338:
2339: return posUpdate.booleanValue();
2340: }
2341:
2342: public int getPositionedUpdate() {
2343: return getBoolean(PROP_POSITIONED_UPDATE);
2344: }
2345:
2346: public void setPositionedUpdate(int value) {
2347: setBoolean(PROP_POSITIONED_UPDATE, value);
2348: }
2349:
2350: /**
2351: * Is SELECT for UPDATE supported?
2352: * @return <code>true</code> if so
2353: * @exception SQLException if a database access error occurs
2354: */
2355: public boolean supportsSelectForUpdate() throws SQLException {
2356: Boolean selectForUpdate = (Boolean) properties
2357: .get(PROP_SELECT_FOR_UPDATE);
2358: if (selectForUpdate == null) {
2359: if (dmd != null)
2360: selectForUpdate = dmd.supportsSelectForUpdate() ? Boolean.TRUE
2361: : Boolean.FALSE;
2362: else
2363: throw new SQLException(bundle
2364: .getString("EXC_NoDBMetadata")); // NOI18N
2365: properties.put(PROP_SELECT_FOR_UPDATE, selectForUpdate);
2366: }
2367:
2368: return selectForUpdate.booleanValue();
2369: }
2370:
2371: public int getSelectForUpdate() {
2372: return getBoolean(PROP_SELECT_FOR_UPDATE);
2373: }
2374:
2375: public void setSelectForUpdate(int value) {
2376: setBoolean(PROP_SELECT_FOR_UPDATE, value);
2377: }
2378:
2379: /**
2380: * Are stored procedure calls using the stored procedure escape
2381: * syntax supported?
2382: * @return <code>true</code> if so
2383: * @exception SQLException if a database access error occurs
2384: */
2385: public boolean supportsStoredProcedures() throws SQLException {
2386: Boolean storedProcedures = (Boolean) properties
2387: .get(PROP_STORED_PROCEDURES);
2388: if (storedProcedures == null) {
2389: if (dmd != null)
2390: storedProcedures = dmd.supportsStoredProcedures() ? Boolean.TRUE
2391: : Boolean.FALSE;
2392: else
2393: throw new SQLException(bundle
2394: .getString("EXC_NoDBMetadata")); // NOI18N
2395: properties.put(PROP_STORED_PROCEDURES, storedProcedures);
2396: }
2397:
2398: return storedProcedures.booleanValue();
2399: }
2400:
2401: public int getStoredProcedures() {
2402: return getBoolean(PROP_STORED_PROCEDURES);
2403: }
2404:
2405: public void setStoredProcedures(int value) {
2406: setBoolean(PROP_STORED_PROCEDURES, value);
2407: }
2408:
2409: /**
2410: * Are subqueries in comparison expressions supported?
2411: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
2412: * @return <code>true</code> if so
2413: * @exception SQLException if a database access error occurs
2414: */
2415: public boolean supportsSubqueriesInComparisons()
2416: throws SQLException {
2417: Boolean subqueryComp = (Boolean) properties
2418: .get(PROP_SUBQUERY_IN_COMPARSIONS);
2419: if (subqueryComp == null) {
2420: if (dmd != null)
2421: subqueryComp = dmd.supportsSubqueriesInComparisons() ? Boolean.TRUE
2422: : Boolean.FALSE;
2423: else
2424: throw new SQLException(bundle
2425: .getString("EXC_NoDBMetadata")); // NOI18N
2426: properties.put(PROP_SUBQUERY_IN_COMPARSIONS, subqueryComp);
2427: }
2428:
2429: return subqueryComp.booleanValue();
2430: }
2431:
2432: public int getSubqueriesInComparisons() {
2433: return getBoolean(PROP_SUBQUERY_IN_COMPARSIONS);
2434: }
2435:
2436: public void setSubqueriesInComparisons(int value) {
2437: setBoolean(PROP_SUBQUERY_IN_COMPARSIONS, value);
2438: }
2439:
2440: /**
2441: * Are subqueries in 'exists' expressions supported?
2442: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
2443: * @return <code>true</code> if so
2444: * @exception SQLException if a database access error occurs
2445: */
2446: public boolean supportsSubqueriesInExists() throws SQLException {
2447: Boolean subqueryExist = (Boolean) properties
2448: .get(PROP_SUBQUERY_IN_EXISTS);
2449: if (subqueryExist == null) {
2450: if (dmd != null)
2451: subqueryExist = dmd.supportsSubqueriesInExists() ? Boolean.TRUE
2452: : Boolean.FALSE;
2453: else
2454: throw new SQLException(bundle
2455: .getString("EXC_NoDBMetadata")); // NOI18N
2456: properties.put(PROP_SUBQUERY_IN_EXISTS, subqueryExist);
2457: }
2458:
2459: return subqueryExist.booleanValue();
2460: }
2461:
2462: public int getSubqueriesInExists() {
2463: return getBoolean(PROP_SUBQUERY_IN_EXISTS);
2464: }
2465:
2466: public void setSubqueriesInExists(int value) {
2467: setBoolean(PROP_SUBQUERY_IN_EXISTS, value);
2468: }
2469:
2470: /**
2471: * Are subqueries in 'in' statements supported?
2472: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
2473: * @return <code>true</code> if so
2474: */
2475: public boolean supportsSubqueriesInIns() throws SQLException {
2476: Boolean subqueryIns = (Boolean) properties
2477: .get(PROP_SUBQUERY_IN_INS);
2478: if (subqueryIns == null) {
2479: if (dmd != null)
2480: subqueryIns = dmd.supportsSubqueriesInIns() ? Boolean.TRUE
2481: : Boolean.FALSE;
2482: else
2483: throw new SQLException(bundle
2484: .getString("EXC_NoDBMetadata")); // NOI18N
2485: properties.put(PROP_SUBQUERY_IN_INS, subqueryIns);
2486: }
2487:
2488: return subqueryIns.booleanValue();
2489: }
2490:
2491: public int getSubqueriesInIns() {
2492: return getBoolean(PROP_SUBQUERY_IN_INS);
2493: }
2494:
2495: public void setSubqueriesInIns(int value) {
2496: setBoolean(PROP_SUBQUERY_IN_INS, value);
2497: }
2498:
2499: /**
2500: * Are subqueries in quantified expressions supported?
2501: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
2502: * @return <code>true</code> if so
2503: * @exception SQLException if a database access error occurs
2504: */
2505: public boolean supportsSubqueriesInQuantifieds()
2506: throws SQLException {
2507: Boolean subqueryQuant = (Boolean) properties
2508: .get(PROP_SUBQUERY_IN_QUANTIFIEDS);
2509: if (subqueryQuant == null) {
2510: if (dmd != null)
2511: subqueryQuant = dmd.supportsSubqueriesInQuantifieds() ? Boolean.TRUE
2512: : Boolean.FALSE;
2513: else
2514: throw new SQLException(bundle
2515: .getString("EXC_NoDBMetadata")); // NOI18N
2516: properties.put(PROP_SUBQUERY_IN_QUANTIFIEDS, subqueryQuant);
2517: }
2518:
2519: return subqueryQuant.booleanValue();
2520: }
2521:
2522: public int getSubqueriesInQuantifieds() {
2523: return getBoolean(PROP_SUBQUERY_IN_QUANTIFIEDS);
2524: }
2525:
2526: public void setSubqueriesInQuantifieds(int value) {
2527: setBoolean(PROP_SUBQUERY_IN_QUANTIFIEDS, value);
2528: }
2529:
2530: /**
2531: * Are correlated subqueries supported?
2532: * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver always returns true.
2533: * @return <code>true</code> if so
2534: * @exception SQLException if a database access error occurs
2535: */
2536: public boolean supportsCorrelatedSubqueries() throws SQLException {
2537: Boolean subqueryCorr = (Boolean) properties
2538: .get(PROP_CORRELATED_SUBQUERIES);
2539: if (subqueryCorr == null) {
2540: if (dmd != null)
2541: subqueryCorr = dmd.supportsCorrelatedSubqueries() ? Boolean.TRUE
2542: : Boolean.FALSE;
2543: else
2544: throw new SQLException(bundle
2545: .getString("EXC_NoDBMetadata")); // NOI18N
2546: properties.put(PROP_CORRELATED_SUBQUERIES, subqueryCorr);
2547: }
2548:
2549: return subqueryCorr.booleanValue();
2550: }
2551:
2552: public int getCorrelatedSubqueries() {
2553: return getBoolean(PROP_CORRELATED_SUBQUERIES);
2554: }
2555:
2556: public void setCorrelatedSubqueries(int value) {
2557: setBoolean(PROP_CORRELATED_SUBQUERIES, value);
2558: }
2559:
2560: /**
2561: * Is SQL UNION supported?
2562: * @return <code>true</code> if so
2563: * @exception SQLException if a database access error occurs
2564: */
2565: public boolean supportsUnion() throws SQLException {
2566: Boolean union = (Boolean) properties.get(PROP_UNION);
2567: if (union == null) {
2568: if (dmd != null)
2569: union = dmd.supportsUnion() ? Boolean.TRUE
2570: : Boolean.FALSE;
2571: else
2572: throw new SQLException(bundle
2573: .getString("EXC_NoDBMetadata")); // NOI18N
2574: properties.put(PROP_UNION, union);
2575: }
2576:
2577: return union.booleanValue();
2578: }
2579:
2580: public int getUnion() {
2581: return getBoolean(PROP_UNION);
2582: }
2583:
2584: public void setUnion(int value) {
2585: setBoolean(PROP_UNION, value);
2586: }
2587:
2588: /**
2589: * Is SQL UNION ALL supported?
2590: * @return <code>true</code> if so
2591: * @exception SQLException if a database access error occurs
2592: */
2593: public boolean supportsUnionAll() throws SQLException {
2594: Boolean unionAll = (Boolean) properties.get(PROP_UNION_ALL);
2595: if (unionAll == null) {
2596: if (dmd != null)
2597: unionAll = dmd.supportsUnionAll() ? Boolean.TRUE
2598: : Boolean.FALSE;
2599: else
2600: throw new SQLException(bundle
2601: .getString("EXC_NoDBMetadata")); // NOI18N
2602: properties.put(PROP_UNION_ALL, unionAll);
2603: }
2604:
2605: return unionAll.booleanValue();
2606: }
2607:
2608: public int getUnionAll() {
2609: return getBoolean(PROP_UNION_ALL);
2610: }
2611:
2612: public void setUnionAll(int value) {
2613: setBoolean(PROP_UNION_ALL, value);
2614: }
2615:
2616: /**
2617: * Can cursors remain open across commits?
2618: * @return <code>true</code> if cursors always remain open
2619: * @exception SQLException if a database access error occurs
2620: */
2621: public boolean supportsOpenCursorsAcrossCommit()
2622: throws SQLException {
2623: Boolean cursorInCommit = (Boolean) properties
2624: .get(PROP_OPEN_CURSORS_ACROSS_COMMIT);
2625: if (cursorInCommit == null) {
2626: if (dmd != null)
2627: cursorInCommit = dmd.supportsOpenCursorsAcrossCommit() ? Boolean.TRUE
2628: : Boolean.FALSE;
2629: else
2630: throw new SQLException(bundle
2631: .getString("EXC_NoDBMetadata")); // NOI18N
2632: properties.put(PROP_OPEN_CURSORS_ACROSS_COMMIT,
2633: cursorInCommit);
2634: }
2635:
2636: return cursorInCommit.booleanValue();
2637: }
2638:
2639: public int getOpenCursorsAcrossCommit() {
2640: return getBoolean(PROP_OPEN_CURSORS_ACROSS_COMMIT);
2641: }
2642:
2643: public void setOpenCursorsAcrossCommit(int value) {
2644: setBoolean(PROP_OPEN_CURSORS_ACROSS_COMMIT, value);
2645: }
2646:
2647: /**
2648: * Can cursors remain open across rollbacks?
2649: * @return <code>true</code> if cursors always remain open
2650: * @exception SQLException if a database access error occurs
2651: */
2652: public boolean supportsOpenCursorsAcrossRollback()
2653: throws SQLException {
2654: Boolean cursorInRollback = (Boolean) properties
2655: .get(PROP_OPEN_CURSORS_ACROSS_ROLLBACK);
2656: if (cursorInRollback == null) {
2657: if (dmd != null)
2658: cursorInRollback = dmd
2659: .supportsOpenCursorsAcrossRollback() ? Boolean.TRUE
2660: : Boolean.FALSE;
2661: else
2662: throw new SQLException(bundle
2663: .getString("EXC_NoDBMetadata")); // NOI18N
2664: properties.put(PROP_OPEN_CURSORS_ACROSS_ROLLBACK,
2665: cursorInRollback);
2666: }
2667:
2668: return cursorInRollback.booleanValue();
2669: }
2670:
2671: public int getOpenCursorsAcrossRollback() {
2672: return getBoolean(PROP_OPEN_CURSORS_ACROSS_ROLLBACK);
2673: }
2674:
2675: public void setOpenCursorsAcrossRollback(int value) {
2676: setBoolean(PROP_OPEN_CURSORS_ACROSS_ROLLBACK, value);
2677: }
2678:
2679: /**
2680: * Can statements remain open across commits?
2681: * @return <code>true</code> if statements always remain open
2682: * @exception SQLException if a database access error occurs
2683: */
2684: public boolean supportsOpenStatementsAcrossCommit()
2685: throws SQLException {
2686: Boolean statementInCommit = (Boolean) properties
2687: .get(PROP_OPEN_STATEMENTS_ACROSS_COMMIT);
2688: if (statementInCommit == null) {
2689: if (dmd != null)
2690: statementInCommit = dmd
2691: .supportsOpenStatementsAcrossCommit() ? Boolean.TRUE
2692: : Boolean.FALSE;
2693: else
2694: throw new SQLException(bundle
2695: .getString("EXC_NoDBMetadata")); // NOI18N
2696: properties.put(PROP_OPEN_STATEMENTS_ACROSS_COMMIT,
2697: statementInCommit);
2698: }
2699:
2700: return statementInCommit.booleanValue();
2701: }
2702:
2703: public int getOpenStatementsAcrossCommit() {
2704: return getBoolean(PROP_OPEN_STATEMENTS_ACROSS_COMMIT);
2705: }
2706:
2707: public void setOpenStatementsAcrossCommit(int value) {
2708: setBoolean(PROP_OPEN_STATEMENTS_ACROSS_COMMIT, value);
2709: }
2710:
2711: /**
2712: * Can statements remain open across rollbacks?
2713: * @return <code>true</code> if statements always remain open
2714: * @exception SQLException if a database access error occurs
2715: */
2716: public boolean supportsOpenStatementsAcrossRollback()
2717: throws SQLException {
2718: Boolean statementInRollback = (Boolean) properties
2719: .get(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK);
2720: if (statementInRollback == null) {
2721: if (dmd != null)
2722: statementInRollback = dmd
2723: .supportsOpenStatementsAcrossRollback() ? Boolean.TRUE
2724: : Boolean.FALSE;
2725: else
2726: throw new SQLException(bundle
2727: .getString("EXC_NoDBMetadata")); // NOI18N
2728: properties.put(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK,
2729: statementInRollback);
2730: }
2731:
2732: return statementInRollback.booleanValue();
2733: }
2734:
2735: public int getOpenStatementsAcrossRollback() {
2736: return getBoolean(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK);
2737: }
2738:
2739: public void setOpenStatementsAcrossRollback(int value) {
2740: setBoolean(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK, value);
2741: }
2742:
2743: /**
2744: * How many hex characters can you have in an inline binary literal?
2745: * @return max binary literal length in hex characters
2746: * @exception SQLException if a database access error occurs
2747: */
2748: public int getMaxBinaryLiteralLength() throws SQLException {
2749: Integer binaryLiteral = (Integer) properties
2750: .get(PROP_MAX_BINARY_LITERAL_LENGTH);
2751: if (binaryLiteral == null && dmd != null) {
2752: binaryLiteral = new Integer(dmd.getMaxBinaryLiteralLength());
2753: properties.put(PROP_MAX_BINARY_LITERAL_LENGTH,
2754: binaryLiteral);
2755: }
2756:
2757: if (binaryLiteral != null)
2758: return binaryLiteral.intValue();
2759: return 0;
2760: }
2761:
2762: public void setMaxBinaryLiteralLength(int value) {
2763: setInt(PROP_MAX_BINARY_LITERAL_LENGTH, value);
2764: }
2765:
2766: /**
2767: * What's the max length for a character literal?
2768: * @return max literal length
2769: * @exception SQLException if a database access error occurs
2770: */
2771: public int getMaxCharLiteralLength() throws SQLException {
2772: Integer maxCharLiteral = (Integer) properties
2773: .get(PROP_MAX_CHAR_LITERAL_LENGTH);
2774: if (maxCharLiteral == null && dmd != null) {
2775: maxCharLiteral = new Integer(dmd.getMaxCharLiteralLength());
2776: properties
2777: .put(PROP_MAX_CHAR_LITERAL_LENGTH, maxCharLiteral);
2778: }
2779:
2780: if (maxCharLiteral != null)
2781: return maxCharLiteral.intValue();
2782: return 0;
2783: }
2784:
2785: public void setMaxCharLiteralLength(int value) {
2786: setInt(PROP_MAX_CHAR_LITERAL_LENGTH, value);
2787: }
2788:
2789: /**
2790: * What's the limit on column name length?
2791: * @return max column name length
2792: * @exception SQLException if a database access error occurs
2793: */
2794: public int getMaxColumnNameLength() throws SQLException {
2795: Integer maxColumnName = (Integer) properties
2796: .get(PROP_MAX_COLUMN_NAME_LENGTH);
2797: if (maxColumnName == null && dmd != null) {
2798: maxColumnName = new Integer(dmd.getMaxColumnNameLength());
2799: properties.put(PROP_MAX_COLUMN_NAME_LENGTH, maxColumnName);
2800: }
2801:
2802: if (maxColumnName != null)
2803: return maxColumnName.intValue();
2804: return 0;
2805: }
2806:
2807: public void setMaxColumnNameLength(int value) {
2808: setInt(PROP_MAX_COLUMN_NAME_LENGTH, value);
2809: }
2810:
2811: /**
2812: * What's the maximum number of columns in a "GROUP BY" clause?
2813: * @return max number of columns
2814: * @exception SQLException if a database access error occurs
2815: */
2816: public int getMaxColumnsInGroupBy() throws SQLException {
2817: Integer maxColumnGroup = (Integer) properties
2818: .get(PROP_MAX_COLUMNS_IN_GROUPBY);
2819: if (maxColumnGroup == null && dmd != null) {
2820: maxColumnGroup = new Integer(dmd.getMaxColumnsInGroupBy());
2821: properties.put(PROP_MAX_COLUMNS_IN_GROUPBY, maxColumnGroup);
2822: }
2823:
2824: if (maxColumnGroup != null)
2825: return maxColumnGroup.intValue();
2826: return 0;
2827: }
2828:
2829: public void setMaxColumnsInGroupBy(int value) {
2830: setInt(PROP_MAX_COLUMNS_IN_GROUPBY, value);
2831: }
2832:
2833: /**
2834: * What's the maximum number of columns allowed in an index?
2835: * @return max number of columns
2836: * @exception SQLException if a database access error occurs
2837: */
2838: public int getMaxColumnsInIndex() throws SQLException {
2839: Integer maxColumnIndex = (Integer) properties
2840: .get(PROP_MAX_COLUMNS_IN_INDEX);
2841: if (maxColumnIndex == null && dmd != null) {
2842: maxColumnIndex = new Integer(dmd.getMaxColumnsInIndex());
2843: properties.put(PROP_MAX_COLUMNS_IN_INDEX, maxColumnIndex);
2844: }
2845:
2846: if (maxColumnIndex != null)
2847: return maxColumnIndex.intValue();
2848: return 0;
2849: }
2850:
2851: public void setMaxColumnsInIndex(int value) {
2852: setInt(PROP_MAX_COLUMNS_IN_INDEX, value);
2853: }
2854:
2855: /**
2856: * What's the maximum number of columns in an "ORDER BY" clause?
2857: * @return max number of columns
2858: * @exception SQLException if a database access error occurs
2859: */
2860: public int getMaxColumnsInOrderBy() throws SQLException {
2861: Integer maxColumnOrderBy = (Integer) properties
2862: .get(PROP_MAX_COLUMNS_IN_ORDERBY);
2863: if (maxColumnOrderBy == null && dmd != null) {
2864: maxColumnOrderBy = new Integer(dmd.getMaxColumnsInOrderBy());
2865: properties.put(PROP_MAX_COLUMNS_IN_ORDERBY,
2866: maxColumnOrderBy);
2867: }
2868:
2869: if (maxColumnOrderBy != null)
2870: return maxColumnOrderBy.intValue();
2871: return 0;
2872: }
2873:
2874: public void setMaxColumnsInOrderBy(int value) {
2875: setInt(PROP_MAX_COLUMNS_IN_ORDERBY, value);
2876: }
2877:
2878: /**
2879: * What's the maximum number of columns in a "SELECT" list?
2880: * @return max number of columns
2881: * @exception SQLException if a database access error occurs
2882: */
2883: public int getMaxColumnsInSelect() throws SQLException {
2884: Integer maxColumnSelect = (Integer) properties
2885: .get(PROP_MAX_COLUMNS_IN_SELECT);
2886: if (maxColumnSelect == null && dmd != null) {
2887: maxColumnSelect = new Integer(dmd.getMaxColumnsInSelect());
2888: properties.put(PROP_MAX_COLUMNS_IN_SELECT, maxColumnSelect);
2889: }
2890:
2891: if (maxColumnSelect != null)
2892: return maxColumnSelect.intValue();
2893: return 0;
2894: }
2895:
2896: public void setMaxColumnsInSelect(int value) {
2897: setInt(PROP_MAX_COLUMNS_IN_SELECT, value);
2898: }
2899:
2900: /**
2901: * What's the maximum number of columns in a table?
2902: * @return max number of columns
2903: * @exception SQLException if a database access error occurs
2904: */
2905: public int getMaxColumnsInTable() throws SQLException {
2906: Integer maxColumnTable = (Integer) properties
2907: .get(PROP_MAX_COLUMNS_IN_TABLE);
2908: if (maxColumnTable == null && dmd != null) {
2909: maxColumnTable = new Integer(dmd.getMaxColumnsInTable());
2910: properties.put(PROP_MAX_COLUMNS_IN_TABLE, maxColumnTable);
2911: }
2912:
2913: if (maxColumnTable != null)
2914: return maxColumnTable.intValue();
2915: return 0;
2916: }
2917:
2918: public void setMaxColumnsInTable(int value) {
2919: setInt(PROP_MAX_COLUMNS_IN_TABLE, value);
2920: }
2921:
2922: /**
2923: * How many active connections can we have at a time to this database?
2924: * @return max number of active connections
2925: * @exception SQLException if a database access error occurs
2926: */
2927: public int getMaxConnections() throws SQLException {
2928: Integer maxConnections = (Integer) properties
2929: .get(PROP_MAX_CONNECTIONS);
2930: if (maxConnections == null && dmd != null) {
2931: maxConnections = new Integer(dmd.getMaxConnections());
2932: properties.put(PROP_MAX_CONNECTIONS, maxConnections);
2933: }
2934:
2935: if (maxConnections != null)
2936: return maxConnections.intValue();
2937: return 0;
2938: }
2939:
2940: public void setMaxConnections(int value) {
2941: setInt(PROP_MAX_CONNECTIONS, value);
2942: }
2943:
2944: /**
2945: * What's the maximum cursor name length?
2946: * @return max cursor name length in bytes
2947: * @exception SQLException if a database access error occurs
2948: */
2949: public int getMaxCursorNameLength() throws SQLException {
2950: Integer maxCursorName = (Integer) properties
2951: .get(PROP_MAX_CURSORNAME_LENGTH);
2952: if (maxCursorName == null && dmd != null) {
2953: maxCursorName = new Integer(dmd.getMaxCursorNameLength());
2954: properties.put(PROP_MAX_CURSORNAME_LENGTH, maxCursorName);
2955: }
2956:
2957: if (maxCursorName != null)
2958: return maxCursorName.intValue();
2959: return 0;
2960: }
2961:
2962: public void setMaxCursorNameLength(int value) {
2963: setInt(PROP_MAX_CURSORNAME_LENGTH, value);
2964: }
2965:
2966: /**
2967: * What's the maximum length of an index (in bytes)?
2968: * @return max index length in bytes
2969: * @exception SQLException if a database access error occurs
2970: */
2971: public int getMaxIndexLength() throws SQLException {
2972: Integer maxIndex = (Integer) properties
2973: .get(PROP_MAX_INDEX_LENGTH);
2974: if (maxIndex == null && dmd != null) {
2975: maxIndex = new Integer(dmd.getMaxIndexLength());
2976: properties.put(PROP_MAX_INDEX_LENGTH, maxIndex);
2977: }
2978:
2979: if (maxIndex != null)
2980: return maxIndex.intValue();
2981: return 0;
2982: }
2983:
2984: public void setMaxIndexLength(int value) {
2985: setInt(PROP_MAX_INDEX_LENGTH, value);
2986: }
2987:
2988: /**
2989: * What's the maximum length allowed for a schema name?
2990: * @return max name length in bytes
2991: * @exception SQLException if a database access error occurs
2992: */
2993: public int getMaxSchemaNameLength() throws SQLException {
2994: Integer maxSchemaName = (Integer) properties
2995: .get(PROP_MAX_SCHEMA_NAME);
2996: if (maxSchemaName == null && dmd != null) {
2997: maxSchemaName = new Integer(dmd.getMaxSchemaNameLength());
2998: properties.put(PROP_MAX_SCHEMA_NAME, maxSchemaName);
2999: }
3000:
3001: if (maxSchemaName != null)
3002: return maxSchemaName.intValue();
3003: return 0;
3004: }
3005:
3006: public void setMaxSchemaNameLength(int value) {
3007: setInt(PROP_MAX_SCHEMA_NAME, value);
3008: }
3009:
3010: /**
3011: * What's the maximum length of a procedure name?
3012: * @return max name length in bytes
3013: * @exception SQLException if a database access error occurs
3014: */
3015: public int getMaxProcedureNameLength() throws SQLException {
3016: Integer maxProcName = (Integer) properties
3017: .get(PROP_MAX_PROCEDURE_NAME);
3018: if (maxProcName == null && dmd != null) {
3019: maxProcName = new Integer(dmd.getMaxProcedureNameLength());
3020: properties.put(PROP_MAX_PROCEDURE_NAME, maxProcName);
3021: }
3022:
3023: if (maxProcName != null)
3024: return maxProcName.intValue();
3025: return 0;
3026: }
3027:
3028: public void setMaxProcedureNameLength(int value) {
3029: setInt(PROP_MAX_PROCEDURE_NAME, value);
3030: }
3031:
3032: /**
3033: * What's the maximum length of a catalog name?
3034: * @return max name length in bytes
3035: * @exception SQLException if a database access error occurs
3036: */
3037: public int getMaxCatalogNameLength() throws SQLException {
3038: Integer maxCatalogName = (Integer) properties
3039: .get(PROP_MAX_CATALOG_NAME);
3040: if (maxCatalogName == null && dmd != null) {
3041: maxCatalogName = new Integer(dmd
3042: .getMaxProcedureNameLength());
3043: properties.put(PROP_MAX_CATALOG_NAME, maxCatalogName);
3044: }
3045:
3046: if (maxCatalogName != null)
3047: return maxCatalogName.intValue();
3048: return 0;
3049: }
3050:
3051: public void setMaxCatalogNameLength(int value) {
3052: setInt(PROP_MAX_CATALOG_NAME, value);
3053: }
3054:
3055: /**
3056: * What's the maximum length of a single row?
3057: * @return max row size in bytes
3058: * @exception SQLException if a database access error occurs
3059: */
3060: public int getMaxRowSize() throws SQLException {
3061: Integer maxRowSize = (Integer) properties
3062: .get(PROP_MAX_ROW_SIZE);
3063: if (maxRowSize == null && dmd != null) {
3064: maxRowSize = new Integer(dmd.getMaxProcedureNameLength());
3065: properties.put(PROP_MAX_ROW_SIZE, maxRowSize);
3066: }
3067:
3068: if (maxRowSize != null)
3069: return maxRowSize.intValue();
3070: return 0;
3071: }
3072:
3073: public void setMaxRowSize(int value) {
3074: setInt(PROP_MAX_ROW_SIZE, value);
3075: }
3076:
3077: /**
3078: * Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY
3079: * blobs?
3080: * @return <code>true</code> if so
3081: * @exception SQLException if a database access error occurs
3082: */
3083: public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
3084: Boolean rowSizeBlobs = (Boolean) properties
3085: .get(PROP_ROWSIZE_INCLUDING_BLOBS);
3086: if (rowSizeBlobs == null) {
3087: if (dmd != null)
3088: rowSizeBlobs = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE
3089: : Boolean.FALSE;
3090: else
3091: throw new SQLException(bundle
3092: .getString("EXC_NoDBMetadata")); // NOI18N
3093: properties.put(PROP_ROWSIZE_INCLUDING_BLOBS, rowSizeBlobs);
3094: }
3095:
3096: return rowSizeBlobs.booleanValue();
3097: }
3098:
3099: public int getMaxRowSizeIncludeBlobs() {
3100: return getBoolean(PROP_ROWSIZE_INCLUDING_BLOBS);
3101: }
3102:
3103: public void setMaxRowSizeIncludeBlobs(int value) {
3104: setBoolean(PROP_ROWSIZE_INCLUDING_BLOBS, value);
3105: }
3106:
3107: /**
3108: * What's the maximum length of a SQL statement?
3109: * @return max length in bytes
3110: * @exception SQLException if a database access error occurs
3111: */
3112: public int getMaxStatementLength() throws SQLException {
3113: Integer maxStatement = (Integer) properties
3114: .get(PROP_MAX_STATEMENT_LENGTH);
3115: if (maxStatement == null && dmd != null) {
3116: maxStatement = new Integer(dmd.getMaxStatementLength());
3117: properties.put(PROP_MAX_STATEMENT_LENGTH, maxStatement);
3118: }
3119:
3120: if (maxStatement != null)
3121: return maxStatement.intValue();
3122: return 0;
3123: }
3124:
3125: public void setMaxStatementLength(int value) {
3126: setInt(PROP_MAX_STATEMENT_LENGTH, value);
3127: }
3128:
3129: /**
3130: * How many active statements can we have open at one time to this
3131: * database?
3132: * @return the maximum number of statements that can be open at one time
3133: * @exception SQLException if a database access error occurs
3134: */
3135: public int getMaxStatements() throws SQLException {
3136: Integer maxStatements = (Integer) properties
3137: .get(PROP_MAX_STATEMENTS);
3138: if (maxStatements == null && dmd != null) {
3139: maxStatements = new Integer(dmd.getMaxStatementLength());
3140: properties.put(PROP_MAX_STATEMENTS, maxStatements);
3141: }
3142:
3143: if (maxStatements != null)
3144: return maxStatements.intValue();
3145: return 0;
3146: }
3147:
3148: public void setMaxStatements(int value) {
3149: setInt(PROP_MAX_STATEMENTS, value);
3150: }
3151:
3152: /**
3153: * What's the maximum length of a table name?
3154: * @return max name length in bytes
3155: * @exception SQLException if a database access error occurs
3156: */
3157: public int getMaxTableNameLength() throws SQLException {
3158: Integer maxTable = (Integer) properties
3159: .get(PROP_MAX_TABLENAME_LENGTH);
3160: if (maxTable == null && dmd != null) {
3161: maxTable = new Integer(dmd.getMaxStatementLength());
3162: properties.put(PROP_MAX_TABLENAME_LENGTH, maxTable);
3163: }
3164:
3165: if (maxTable != null)
3166: return maxTable.intValue();
3167: return 0;
3168: }
3169:
3170: public void setMaxTableNameLength(int value) {
3171: setInt(PROP_MAX_TABLENAME_LENGTH, value);
3172: }
3173:
3174: /**
3175: * What's the maximum number of tables in a SELECT statement?
3176: * @return the maximum number of tables allowed in a SELECT statement
3177: * @exception SQLException if a database access error occurs
3178: */
3179: public int getMaxTablesInSelect() throws SQLException {
3180: Integer maxTable = (Integer) properties
3181: .get(PROP_MAX_TABLES_IN_SELECT);
3182: if (maxTable == null && dmd != null) {
3183: maxTable = new Integer(dmd.getMaxStatementLength());
3184: properties.put(PROP_MAX_TABLES_IN_SELECT, maxTable);
3185: }
3186:
3187: if (maxTable != null)
3188: return maxTable.intValue();
3189: return 0;
3190: }
3191:
3192: public void setMaxTablesInSelect(int value) {
3193: setInt(PROP_MAX_TABLES_IN_SELECT, value);
3194: }
3195:
3196: /**
3197: * What's the maximum length of a user name?
3198: * @return max user name length in bytes
3199: * @exception SQLException if a database access error occurs
3200: */
3201: public int getMaxUserNameLength() throws SQLException {
3202: Integer maxUserName = (Integer) properties
3203: .get(PROP_MAX_USERNAME);
3204: if (maxUserName == null && dmd != null) {
3205: maxUserName = new Integer(dmd.getMaxUserNameLength());
3206: properties.put(PROP_MAX_USERNAME, maxUserName);
3207: }
3208:
3209: if (maxUserName != null)
3210: return maxUserName.intValue();
3211: return 0;
3212: }
3213:
3214: public void setMaxUserNameLength(int value) {
3215: setInt(PROP_MAX_USERNAME, value);
3216: }
3217:
3218: /**
3219: * What's the database's default transaction isolation level? The
3220: * values are defined in <code>java.sql.Connection</code>.
3221: * @return the default isolation level
3222: * @exception SQLException if a database access error occurs
3223: */
3224: public int getDefaultTransactionIsolation() throws SQLException {
3225: Integer maxTransaction = (Integer) properties
3226: .get(PROP_DEFAULT_ISOLATION);
3227: if (maxTransaction == null && dmd != null) {
3228: maxTransaction = new Integer(dmd
3229: .getDefaultTransactionIsolation());
3230: properties.put(PROP_DEFAULT_ISOLATION, maxTransaction);
3231: }
3232:
3233: if (maxTransaction != null)
3234: return maxTransaction.intValue();
3235: return 0;
3236: }
3237:
3238: public void setDefaultTransactionIsolation(int value) {
3239: setInt(PROP_DEFAULT_ISOLATION, value);
3240: }
3241:
3242: /**
3243: * Are transactions supported? If not, invoking the method
3244: * @return <code>true</code> if transactions are supported
3245: * @exception SQLException if a database access error occurs
3246: */
3247: public boolean supportsTransactions() throws SQLException {
3248: Boolean trans = (Boolean) properties.get(PROP_TRANSACTIONS);
3249: if (trans == null) {
3250: if (dmd != null)
3251: trans = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE
3252: : Boolean.FALSE;
3253: else
3254: throw new SQLException(bundle
3255: .getString("EXC_NoDBMetadata")); // NOI18N
3256: properties.put(PROP_TRANSACTIONS, trans);
3257: }
3258:
3259: return trans.booleanValue();
3260: }
3261:
3262: public int getTransactions() {
3263: return getBoolean(PROP_TRANSACTIONS);
3264: }
3265:
3266: public void setTransactions(int value) {
3267: setBoolean(PROP_TRANSACTIONS, value);
3268: }
3269:
3270: /**
3271: * Does this database support the given transaction isolation level?
3272: * @param level the values are defined in <code>java.sql.Connection</code>
3273: * @return <code>true</code> if so
3274: * @exception SQLException if a database access error occurs
3275: */
3276: public boolean supportsTransactionIsolationLevel(int level)
3277: throws SQLException {
3278: if (dmd != null)
3279: return dmd.supportsTransactionIsolationLevel(level);
3280: else
3281: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3282: }
3283:
3284: /**
3285: * Are both data definition and data manipulation statements
3286: * within a transaction supported?
3287: * @return <code>true</code> if so
3288: * @exception SQLException if a database access error occurs
3289: */
3290: public boolean supportsDataDefinitionAndDataManipulationTransactions()
3291: throws SQLException {
3292: Boolean flag = (Boolean) properties
3293: .get(PROP_DDL_AND_DML_TRANSACTIONS);
3294: if (flag == null) {
3295: if (dmd != null)
3296: flag = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE
3297: : Boolean.FALSE;
3298: else
3299: throw new SQLException(bundle
3300: .getString("EXC_NoDBMetadata")); // NOI18N
3301: properties.put(PROP_DDL_AND_DML_TRANSACTIONS, flag);
3302: }
3303:
3304: return flag.booleanValue();
3305: }
3306:
3307: public int getDataDefinitionAndDataManipulationTransactions() {
3308: return getBoolean(PROP_DDL_AND_DML_TRANSACTIONS);
3309: }
3310:
3311: public void setDataDefinitionAndDataManipulationTransactions(
3312: int value) {
3313: setBoolean(PROP_DDL_AND_DML_TRANSACTIONS, value);
3314: }
3315:
3316: /**
3317: * Are only data manipulation statements within a transaction
3318: * supported?
3319: * @return <code>true</code> if so
3320: * @exception SQLException if a database access error occurs
3321: */
3322: public boolean supportsDataManipulationTransactionsOnly()
3323: throws SQLException {
3324: Boolean flag = (Boolean) properties
3325: .get(PROP_DML_TRANSACTIONS_ONLY);
3326: if (flag == null) {
3327: if (dmd != null)
3328: flag = dmd.supportsDataManipulationTransactionsOnly() ? Boolean.TRUE
3329: : Boolean.FALSE;
3330: else
3331: throw new SQLException(bundle
3332: .getString("EXC_NoDBMetadata")); // NOI18N
3333: properties.put(PROP_DML_TRANSACTIONS_ONLY, flag);
3334: }
3335:
3336: return flag.booleanValue();
3337: }
3338:
3339: public int getDataManipulationTransactionsOnly() {
3340: return getBoolean(PROP_DML_TRANSACTIONS_ONLY);
3341: }
3342:
3343: public void setDataManipulationTransactionsOnly(int value) {
3344: setBoolean(PROP_DML_TRANSACTIONS_ONLY, value);
3345: }
3346:
3347: /**
3348: * Does a data definition statement within a transaction force the
3349: * transaction to commit?
3350: * @return <code>true</code> if so
3351: * @exception SQLException if a database access error occurs
3352: */
3353: public boolean dataDefinitionCausesTransactionCommit()
3354: throws SQLException {
3355: Boolean flag = (Boolean) properties.get(PROP_DDL_CAUSES_COMMIT);
3356: if (flag == null) {
3357: if (dmd != null)
3358: flag = dmd.dataDefinitionCausesTransactionCommit() ? Boolean.TRUE
3359: : Boolean.FALSE;
3360: else
3361: throw new SQLException(bundle
3362: .getString("EXC_NoDBMetadata")); // NOI18N
3363: properties.put(PROP_DDL_CAUSES_COMMIT, flag);
3364: }
3365:
3366: return flag.booleanValue();
3367: }
3368:
3369: public int getDataDefinitionCausesTransactionCommit() {
3370: return getBoolean(PROP_DDL_CAUSES_COMMIT);
3371: }
3372:
3373: public void setDataDefinitionCausesTransactionCommit(int value) {
3374: setBoolean(PROP_DDL_CAUSES_COMMIT, value);
3375: }
3376:
3377: /**
3378: * Is a data definition statement within a transaction ignored?
3379: * @return <code>true</code> if so
3380: * @exception SQLException if a database access error occurs
3381: */
3382: public boolean dataDefinitionIgnoredInTransactions()
3383: throws SQLException {
3384: Boolean flag = (Boolean) properties
3385: .get(PROP_DDL_IGNORED_IN_TRANSACTIONS);
3386: if (flag == null) {
3387: if (dmd != null)
3388: flag = dmd.dataDefinitionIgnoredInTransactions() ? Boolean.TRUE
3389: : Boolean.FALSE;
3390: else
3391: throw new SQLException(bundle
3392: .getString("EXC_NoDBMetadata")); // NOI18N
3393: properties.put(PROP_DDL_IGNORED_IN_TRANSACTIONS, flag);
3394: }
3395:
3396: return flag.booleanValue();
3397: }
3398:
3399: public int getDataDefinitionIgnoredInTransactions() {
3400: return getBoolean(PROP_DDL_IGNORED_IN_TRANSACTIONS);
3401: }
3402:
3403: public void setDataDefinitionIgnoredInTransactions(int value) {
3404: setBoolean(PROP_DDL_IGNORED_IN_TRANSACTIONS, value);
3405: }
3406:
3407: /**
3408: * Gets a description of the stored procedures available in a
3409: * catalog.
3410: */
3411: public ResultSet getProcedures(String catalog,
3412: String schemaPattern, String procedureNamePattern)
3413: throws SQLException {
3414: if (getCapitializeUsername() && schemaPattern != null)
3415: schemaPattern = schemaPattern.toUpperCase();
3416: String query = (String) properties.get(PROP_PROCEDURES_QUERY);
3417: if (query != null) {
3418: if (con != null) {
3419: PreparedStatement stmt = con.prepareStatement(query);
3420: stmt.setString(1, catalog);
3421: stmt.setString(2, schemaPattern);
3422: stmt.setString(3, procedureNamePattern);
3423: return stmt.executeQuery();
3424: } else
3425: throw new SQLException(bundle
3426: .getString("EXC_NoConnection")); // NOI18N
3427: }
3428:
3429: if (dmd == null)
3430: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3431: return dmd.getProcedures(catalog, schemaPattern,
3432: procedureNamePattern);
3433: }
3434:
3435: public String getProceduresQuery() {
3436: return getString(PROP_PROCEDURES_QUERY);
3437: }
3438:
3439: public void setProceduresQuery(String value) {
3440: setString(PROP_PROCEDURES_QUERY, value);
3441: }
3442:
3443: /**
3444: * Gets a description of a catalog's stored procedure parameters
3445: * and result columns.
3446: */
3447: public ResultSet getProcedureColumns(String catalog,
3448: String schemaPattern, String procedureNamePattern,
3449: String columnNamePattern) throws SQLException {
3450: if (getCapitializeUsername() && schemaPattern != null)
3451: schemaPattern = schemaPattern.toUpperCase();
3452: String query = (String) properties
3453: .get(PROP_PROCEDURE_COLUMNS_QUERY);
3454: if (query != null) {
3455: if (con != null) {
3456: PreparedStatement stmt = con.prepareStatement(query);
3457: stmt.setString(1, catalog);
3458: stmt.setString(2, schemaPattern);
3459: stmt.setString(3, procedureNamePattern);
3460: stmt.setString(4, columnNamePattern);
3461: return stmt.executeQuery();
3462: } else
3463: throw new SQLException(bundle
3464: .getString("EXC_NoConnection")); // NOI18N
3465: }
3466:
3467: if (dmd == null)
3468: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3469: return dmd.getProcedureColumns(catalog, schemaPattern,
3470: procedureNamePattern, columnNamePattern);
3471: }
3472:
3473: public String getProcedureColumnsQuery() {
3474: return getString(PROP_PROCEDURE_COLUMNS_QUERY);
3475: }
3476:
3477: public void setProcedureColumnsQuery(String value) {
3478: setString(PROP_PROCEDURE_COLUMNS_QUERY, value);
3479: }
3480:
3481: /**
3482: * Gets the schema names available in this database. The results
3483: * are ordered by schema name.
3484: */
3485: public ResultSet getSchemas() throws SQLException {
3486: String query = (String) properties
3487: .get(PROP_PROCEDURE_COLUMNS_QUERY);
3488: if (query != null) {
3489: if (con != null)
3490: return con.createStatement().executeQuery(query);
3491: else
3492: throw new SQLException(bundle
3493: .getString("EXC_NoConnection")); // NOI18N
3494: }
3495:
3496: if (dmd == null)
3497: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3498: return dmd.getSchemas();
3499: }
3500:
3501: public String getSchemasQuery() {
3502: return getString(PROP_SCHEMAS_QUERY);
3503: }
3504:
3505: public void setSchemasQuery(String value) {
3506: setString(PROP_SCHEMAS_QUERY, value);
3507: }
3508:
3509: /**
3510: * Gets the catalog names available in this database. The results
3511: * are ordered by catalog name.
3512: * @exception SQLException if a database access error occurs
3513: */
3514: public ResultSet getCatalogs() throws SQLException {
3515: String query = (String) properties.get(PROP_CATALOGS_QUERY);
3516: if (query != null) {
3517: if (con != null)
3518: return con.createStatement().executeQuery(query);
3519: else
3520: throw new SQLException(bundle
3521: .getString("EXC_NoConnection")); // NOI18N
3522: }
3523:
3524: if (dmd == null)
3525: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3526: return dmd.getCatalogs();
3527: }
3528:
3529: public String getCatalogsQuery() {
3530: return getString(PROP_CATALOGS_QUERY);
3531: }
3532:
3533: public void setCatalogsQuery(String value) {
3534: setString(PROP_CATALOGS_QUERY, value);
3535: }
3536:
3537: /**
3538: * Gets the table types available in this database. The results
3539: * are ordered by table type.
3540: */
3541: public ResultSet getTableTypes() throws SQLException {
3542: String query = (String) properties.get(PROP_TABLE_TYPES_QUERY);
3543: if (query != null) {
3544: if (con != null)
3545: return con.createStatement().executeQuery(query);
3546: else
3547: throw new SQLException(bundle
3548: .getString("EXC_NoConnection")); // NOI18N
3549: }
3550:
3551: if (dmd == null)
3552: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3553: return dmd.getCatalogs();
3554: }
3555:
3556: public String getTableTypesQuery() {
3557: return getString(PROP_TABLE_TYPES_QUERY);
3558: }
3559:
3560: public void setTableTypesQuery(String value) {
3561: setString(PROP_TABLE_TYPES_QUERY, value);
3562: }
3563:
3564: /**
3565: * Gets a description of table columns available in
3566: * the specified catalog.
3567: */
3568: public ResultSet getColumns(String catalog, String schemaPattern,
3569: String tableNamePattern, String columnNamePattern)
3570: throws SQLException {
3571: if (getCapitializeUsername() && schemaPattern != null)
3572: schemaPattern = schemaPattern.toUpperCase();
3573: String query = (String) properties.get(PROP_COLUMNS_QUERY);
3574: if (query != null) {
3575: if (con != null) {
3576: PreparedStatement stmt = con.prepareStatement(query);
3577: stmt.setString(1, catalog);
3578: stmt.setString(2, schemaPattern);
3579: stmt.setString(3, tableNamePattern);
3580: stmt.setString(4, columnNamePattern);
3581: return stmt.executeQuery();
3582: } else
3583: throw new SQLException(bundle
3584: .getString("EXC_NoConnection")); // NOI18N
3585: }
3586:
3587: if (dmd == null)
3588: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3589: return dmd.getColumns(catalog, schemaPattern, tableNamePattern,
3590: columnNamePattern);
3591: }
3592:
3593: public String getColumnsQuery() {
3594: return getString(PROP_COLUMNS_QUERY);
3595: }
3596:
3597: public void setColumnsQuery(String value) {
3598: setString(PROP_COLUMNS_QUERY, value);
3599: }
3600:
3601: /**
3602: * Gets a description of the access rights for a table's columns.
3603: */
3604: public ResultSet getColumnPrivileges(String catalog, String schema,
3605: String table, String columnNamePattern) throws SQLException {
3606: if (getCapitializeUsername() && schema != null)
3607: schema = schema.toUpperCase();
3608: String query = (String) properties
3609: .get(PROP_COLUMNS_PRIVILEGES_QUERY);
3610: if (query != null) {
3611: if (con != null) {
3612: PreparedStatement stmt = con.prepareStatement(query);
3613: stmt.setString(1, catalog);
3614: stmt.setString(2, schema);
3615: stmt.setString(3, table);
3616: stmt.setString(4, columnNamePattern);
3617: return stmt.executeQuery();
3618: } else
3619: throw new SQLException(bundle
3620: .getString("EXC_NoConnection")); // NOI18N
3621: }
3622:
3623: if (dmd == null)
3624: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3625: return dmd.getColumnPrivileges(catalog, schema, table,
3626: columnNamePattern);
3627: }
3628:
3629: public String getColumnPrivilegesQuery() {
3630: return getString(PROP_COLUMNS_PRIVILEGES_QUERY);
3631: }
3632:
3633: public void setColumnPrivilegesQuery(String value) {
3634: setString(PROP_COLUMNS_PRIVILEGES_QUERY, value);
3635: }
3636:
3637: /**
3638: * Gets a description of tables available in a catalog.
3639: * Only table descriptions matching the catalog, schema, table
3640: * name and type criteria are returned. They are ordered by TABLE_TYPE,
3641: * TABLE_SCHEM and TABLE_NAME.
3642: */
3643: public ResultSet getTables(String catalog, String schemaPattern,
3644: String tableNamePattern, String[] types)
3645: throws SQLException {
3646: if (getCapitializeUsername() && schemaPattern != null)
3647: schemaPattern = schemaPattern.toUpperCase();
3648: String query = (String) properties.get(PROP_TABLES_QUERY);
3649: if (query != null) {
3650: if (con != null) {
3651: StringBuffer typebuff = new StringBuffer();
3652: PreparedStatement stmt = con.prepareStatement(query);
3653: stmt.setString(1, catalog);
3654: stmt.setString(2, schemaPattern);
3655: stmt.setString(3, tableNamePattern);
3656:
3657: for (int i = 0; i < types.length; i++) {
3658: if (i > 0)
3659: typebuff.append(", ");
3660: typebuff.append("'");
3661: typebuff.append(types[i]);
3662: typebuff.append("'");
3663: }
3664:
3665: stmt.setString(4, typebuff.toString());
3666: return stmt.executeQuery();
3667: } else
3668: throw new SQLException(bundle
3669: .getString("EXC_NoConnection")); // NOI18N
3670: }
3671:
3672: if (dmd == null)
3673: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3674: return dmd.getTables(catalog, schemaPattern, tableNamePattern,
3675: types);
3676: }
3677:
3678: public String getTablesQuery() {
3679: return getString(PROP_TABLES_QUERY);
3680: }
3681:
3682: public void setTablesQuery(String value) {
3683: setString(PROP_TABLES_QUERY, value);
3684: }
3685:
3686: /**
3687: * Gets a description of the access rights for each table available
3688: * in a catalog. Note that a table privilege applies to one or
3689: * more columns in the table. It would be wrong to assume that
3690: * this priviledge applies to all columns (this may be true for
3691: * some systems but is not true for all.)
3692: */
3693: public ResultSet getTablePrivileges(String catalog,
3694: String schemaPattern, String tableNamePattern)
3695: throws SQLException {
3696: if (getCapitializeUsername() && schemaPattern != null)
3697: schemaPattern = schemaPattern.toUpperCase();
3698: String query = (String) properties
3699: .get(PROP_TABLE_PRIVILEGES_QUERY);
3700: if (query != null) {
3701: if (con != null) {
3702: PreparedStatement stmt = con.prepareStatement(query);
3703: stmt.setString(1, catalog);
3704: stmt.setString(2, schemaPattern);
3705: stmt.setString(3, tableNamePattern);
3706: return stmt.executeQuery();
3707: } else
3708: throw new SQLException(bundle
3709: .getString("EXC_NoConnection")); // NOI18N
3710: }
3711:
3712: if (dmd == null)
3713: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3714: return dmd.getTablePrivileges(catalog, schemaPattern,
3715: tableNamePattern);
3716: }
3717:
3718: public String getTablePrivilegesQuery() {
3719: return getString(PROP_TABLE_PRIVILEGES_QUERY);
3720: }
3721:
3722: public void setTablePrivilegesQuery(String value) {
3723: setString(PROP_TABLE_PRIVILEGES_QUERY, value);
3724: }
3725:
3726: /**
3727: * Gets a description of a table's optimal set of columns that
3728: * uniquely identifies a row. They are ordered by SCOPE.
3729: */
3730: public ResultSet getBestRowIdentifier(String catalog,
3731: String schema, String table, int scope, boolean nullable)
3732: throws SQLException {
3733: if (getCapitializeUsername() && schema != null)
3734: schema = schema.toUpperCase();
3735: String query = (String) properties
3736: .get(PROP_BEST_ROW_IDENTIFIER);
3737: if (query != null) {
3738: if (con != null) {
3739: PreparedStatement stmt = con.prepareStatement(query);
3740: stmt.setString(1, catalog);
3741: stmt.setString(2, schema);
3742: stmt.setString(3, table);
3743: stmt.setInt(4, scope);
3744: stmt.setBoolean(5, nullable);
3745: return stmt.executeQuery();
3746: } else
3747: throw new SQLException(bundle
3748: .getString("EXC_NoConnection")); // NOI18N
3749: }
3750:
3751: if (dmd == null)
3752: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3753: return dmd.getBestRowIdentifier(catalog, schema, table, scope,
3754: nullable);
3755: }
3756:
3757: public String getBestRowIdentifierQuery() {
3758: return getString(PROP_BEST_ROW_IDENTIFIER);
3759: }
3760:
3761: public void setBestRowIdentifierQuery(String value) {
3762: setString(PROP_BEST_ROW_IDENTIFIER, value);
3763: }
3764:
3765: /**
3766: * Gets a description of a table's columns that are automatically
3767: * updated when any value in a row is updated. They are
3768: * unordered.
3769: */
3770: public ResultSet getVersionColumns(String catalog, String schema,
3771: String table) throws SQLException {
3772: if (getCapitializeUsername() && schema != null)
3773: schema = schema.toUpperCase();
3774: String query = (String) properties.get(PROP_VERSION_COLUMNS);
3775: if (query != null) {
3776: if (con != null) {
3777: PreparedStatement stmt = con.prepareStatement(query);
3778: stmt.setString(1, catalog);
3779: stmt.setString(2, schema);
3780: stmt.setString(3, table);
3781: return stmt.executeQuery();
3782: } else
3783: throw new SQLException(bundle
3784: .getString("EXC_NoConnection")); // NOI18N
3785: }
3786:
3787: if (dmd == null)
3788: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3789: return dmd.getVersionColumns(catalog, schema, table);
3790: }
3791:
3792: public String getVersionColumnsQuery() {
3793: return getString(PROP_VERSION_COLUMNS);
3794: }
3795:
3796: public void setVersionColumnsQuery(String value) {
3797: setString(PROP_VERSION_COLUMNS, value);
3798: }
3799:
3800: /**
3801: * Gets a description of a table's primary key columns. They
3802: * are ordered by COLUMN_NAME.
3803: */
3804: public ResultSet getPrimaryKeys(String catalog, String schema,
3805: String table) throws SQLException {
3806: if (getCapitializeUsername() && schema != null)
3807: schema = schema.toUpperCase();
3808: String query = (String) properties.get(PROP_PK_QUERY);
3809: if (query != null) {
3810: if (con != null) {
3811: PreparedStatement stmt = con.prepareStatement(query);
3812: stmt.setString(1, catalog);
3813: stmt.setString(2, schema);
3814: stmt.setString(3, table);
3815: return stmt.executeQuery();
3816: } else
3817: throw new SQLException(bundle
3818: .getString("EXC_NoConnection")); // NOI18N
3819: }
3820:
3821: if (dmd == null)
3822: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3823: return dmd.getPrimaryKeys(catalog, schema, table);
3824: }
3825:
3826: public String getPrimaryKeysQuery() {
3827: return getString(PROP_PK_QUERY);
3828: }
3829:
3830: public void setPrimaryKeysQuery(String value) {
3831: setString(PROP_PK_QUERY, value);
3832: }
3833:
3834: /**
3835: * Gets a description of the primary key columns that are
3836: * referenced by a table's foreign key columns (the primary keys
3837: * imported by a table). They are ordered by PKTABLE_CAT,
3838: * PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.
3839: * @see #getExportedKeys
3840: */
3841: public ResultSet getImportedKeys(String catalog, String schema,
3842: String table) throws SQLException {
3843: if (getCapitializeUsername() && schema != null)
3844: schema = schema.toUpperCase();
3845: String query = (String) properties.get(PROP_IK_QUERY);
3846: if (query != null) {
3847: if (con != null) {
3848: PreparedStatement stmt = con.prepareStatement(query);
3849: stmt.setString(1, catalog);
3850: stmt.setString(2, schema);
3851: stmt.setString(3, table);
3852: return stmt.executeQuery();
3853: } else
3854: throw new SQLException(bundle
3855: .getString("EXC_NoConnection")); // NOI18N
3856: }
3857:
3858: if (dmd == null)
3859: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3860: return dmd.getImportedKeys(catalog, schema, table);
3861: }
3862:
3863: public String getImportedKeysQuery() {
3864: return getString(PROP_IK_QUERY);
3865: }
3866:
3867: public void setImportedKeysQuery(String value) {
3868: setString(PROP_IK_QUERY, value);
3869: }
3870:
3871: /**
3872: * Gets a description of the foreign key columns that reference a
3873: * table's primary key columns (the foreign keys exported by a
3874: * table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
3875: * FKTABLE_NAME, and KEY_SEQ.
3876: * @see #getImportedKeys
3877: */
3878: public ResultSet getExportedKeys(String catalog, String schema,
3879: String table) throws SQLException {
3880: if (getCapitializeUsername() && schema != null)
3881: schema = schema.toUpperCase();
3882: String query = (String) properties.get(PROP_EK_QUERY);
3883: if (query != null) {
3884: if (con != null) {
3885: PreparedStatement stmt = con.prepareStatement(query);
3886: stmt.setString(1, catalog);
3887: stmt.setString(2, schema);
3888: stmt.setString(3, table);
3889: return stmt.executeQuery();
3890: } else
3891: throw new SQLException(bundle
3892: .getString("EXC_NoConnection")); // NOI18N
3893: }
3894:
3895: if (dmd == null)
3896: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3897: return dmd.getExportedKeys(catalog, schema, table);
3898: }
3899:
3900: public String getExportedKeysQuery() {
3901: return getString(PROP_EK_QUERY);
3902: }
3903:
3904: public void setExportedKeysQuery(String value) {
3905: setString(PROP_EK_QUERY, value);
3906: }
3907:
3908: /**
3909: * Gets a description of the foreign key columns in the foreign key
3910: * table that reference the primary key columns of the primary key
3911: * table (describe how one table imports another's key.) This
3912: * should normally return a single foreign key/primary key pair
3913: * (most tables only import a foreign key from a table once.) They
3914: * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
3915: * KEY_SEQ.
3916: */
3917: public ResultSet getCrossReference(String catalog, String schema,
3918: String table, String foreignCatalog, String foreignSchema,
3919: String foreignTable) throws SQLException {
3920: if (getCapitializeUsername() && schema != null)
3921: schema = schema.toUpperCase();
3922: String query = (String) properties.get(PROP_CROSSREF_QUERY);
3923: if (query != null) {
3924: if (con != null) {
3925: PreparedStatement stmt = con.prepareStatement(query);
3926: stmt.setString(1, catalog);
3927: stmt.setString(2, schema);
3928: stmt.setString(3, table);
3929: stmt.setString(4, foreignCatalog);
3930: stmt.setString(5, foreignSchema);
3931: stmt.setString(6, foreignTable);
3932: return stmt.executeQuery();
3933: } else
3934: throw new SQLException(bundle
3935: .getString("EXC_NoConnection")); // NOI18N
3936: }
3937:
3938: if (dmd == null)
3939: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3940: return dmd.getCrossReference(catalog, schema, table,
3941: foreignCatalog, foreignSchema, foreignTable);
3942: }
3943:
3944: public String getCrossReferenceQuery() {
3945: return getString(PROP_CROSSREF_QUERY);
3946: }
3947:
3948: public void setCrossReferenceQuery(String value) {
3949: setString(PROP_CROSSREF_QUERY, value);
3950: }
3951:
3952: /**
3953: * Gets a description of all the standard SQL types supported by
3954: * this database. They are ordered by DATA_TYPE and then by how
3955: * closely the data type maps to the corresponding JDBC SQL type.
3956: */
3957: public ResultSet getTypeInfo() throws SQLException {
3958: String query = (String) properties.get(PROP_TYPE_INFO_QUERY);
3959: if (query != null) {
3960: if (con != null)
3961: return con.createStatement().executeQuery(query);
3962: else
3963: throw new SQLException(bundle
3964: .getString("EXC_NoConnection")); // NOI18N
3965: }
3966:
3967: if (dmd == null)
3968: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
3969: return dmd.getTypeInfo();
3970: }
3971:
3972: public String getTypeInfoQuery() {
3973: return getString(PROP_TYPE_INFO_QUERY);
3974: }
3975:
3976: public void setTypeInfoQuery(String value) {
3977: setString(PROP_TYPE_INFO_QUERY, value);
3978: }
3979:
3980: /**
3981: * Gets a description of a table's indices and statistics. They are
3982: * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
3983: *
3984: */
3985: public ResultSet getIndexInfo(String catalog, String schema,
3986: String table, boolean unique, boolean approximate)
3987: throws SQLException {
3988: if (getCapitializeUsername() && schema != null)
3989: schema = schema.toUpperCase();
3990: String query = (String) properties.get(PROP_INDEX_INFO_QUERY);
3991: if (query != null) {
3992: if (con != null) {
3993: PreparedStatement stmt = con.prepareStatement(query);
3994: stmt.setString(1, catalog);
3995: stmt.setString(2, schema);
3996: stmt.setString(3, table);
3997: stmt.setBoolean(4, unique);
3998: stmt.setBoolean(5, approximate);
3999: return stmt.executeQuery();
4000: } else
4001: throw new SQLException(bundle
4002: .getString("EXC_NoConnection")); // NOI18N
4003: }
4004:
4005: if (dmd == null)
4006: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4007: return dmd.getIndexInfo(catalog, schema, table, unique,
4008: approximate);
4009: }
4010:
4011: public String getIndexInfoQuery() {
4012: return getString(PROP_INDEX_INFO_QUERY);
4013: }
4014:
4015: public void setIndexInfoQuery(String value) {
4016: setString(PROP_INDEX_INFO_QUERY, value);
4017: }
4018:
4019: /**
4020: * Does the database support the given result set type?
4021: * @param type defined in <code>java.sql.ResultSet</code>
4022: * @return <code>true</code> if so
4023: * @exception SQLException if a database access error occurs
4024: * @see Connection
4025: */
4026: public boolean supportsResultSetType(int type) throws SQLException {
4027: if (dmd != null)
4028: return dmd.supportsResultSetType(type);
4029: else
4030: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4031: }
4032:
4033: /**
4034: * Does the database support the concurrency type in combination
4035: * with the given result set type?
4036: * @param type defined in <code>java.sql.ResultSet</code>
4037: * @param concurrency type defined in <code>java.sql.ResultSet</code>
4038: * @return <code>true</code> if so
4039: * @exception SQLException if a database access error occurs
4040: * @see Connection
4041: */
4042: public boolean supportsResultSetConcurrency(int type,
4043: int concurrency) throws SQLException {
4044: if (dmd != null)
4045: return dmd.supportsResultSetConcurrency(type, concurrency);
4046: else
4047: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4048: }
4049:
4050: /**
4051: * Indicates whether a result set's own updates are visible.
4052: * @param result set type, i.e. ResultSet.TYPE_XXX
4053: * @exception SQLException if a database access error occurs
4054: */
4055: public boolean ownUpdatesAreVisible(int type) throws SQLException {
4056: if (dmd != null)
4057: return dmd.ownUpdatesAreVisible(type);
4058: else
4059: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4060: }
4061:
4062: /**
4063: * Indicates whether a result set's own deletes are visible.
4064: * @param result set type, i.e. ResultSet.TYPE_XXX
4065: * @return <code>true</code> if deletes are visible for the result set type
4066: * @exception SQLException if a database access error occurs
4067: */
4068: public boolean ownDeletesAreVisible(int type) throws SQLException {
4069: if (dmd != null)
4070: return dmd.ownDeletesAreVisible(type);
4071: else
4072: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4073: }
4074:
4075: /**
4076: * Indicates whether a result set's own inserts are visible.
4077: * @param result set type, i.e. ResultSet.TYPE_XXX
4078: * @return <code>true</code> if inserts are visible for the result set type
4079: * @exception SQLException if a database access error occurs
4080: */
4081: public boolean ownInsertsAreVisible(int type) throws SQLException {
4082: if (dmd != null)
4083: return dmd.ownInsertsAreVisible(type);
4084: else
4085: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4086: }
4087:
4088: /**
4089: * Indicates whether updates made by others are visible.
4090: * @param result set type, i.e. ResultSet.TYPE_XXX
4091: * @return <code>true</code> if updates made by others
4092: * are visible for the result set type
4093: * @exception SQLException if a database access error occurs
4094: */
4095: public boolean othersUpdatesAreVisible(int type)
4096: throws SQLException {
4097: if (dmd != null)
4098: return dmd.othersUpdatesAreVisible(type);
4099: else
4100: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4101: }
4102:
4103: /**
4104: * Indicates whether deletes made by others are visible.
4105: * @param result set type, i.e. ResultSet.TYPE_XXX
4106: * @return <code>true</code> if deletes made by others
4107: * are visible for the result set type
4108: * @exception SQLException if a database access error occurs
4109: */
4110: public boolean othersDeletesAreVisible(int type)
4111: throws SQLException {
4112: if (dmd != null)
4113: return dmd.othersDeletesAreVisible(type);
4114: else
4115: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4116: }
4117:
4118: /**
4119: * Indicates whether inserts made by others are visible.
4120: * @param result set type, i.e. ResultSet.TYPE_XXX
4121: * @return true if updates are visible for the result set type
4122: * @return <code>true</code> if inserts made by others
4123: * are visible for the result set type
4124: * @exception SQLException if a database access error occurs
4125: */
4126: public boolean othersInsertsAreVisible(int type)
4127: throws SQLException {
4128: if (dmd != null)
4129: return dmd.othersInsertsAreVisible(type);
4130: else
4131: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4132: }
4133:
4134: /**
4135: * Indicates whether or not a visible row update can be detected by
4136: * calling the method <code>ResultSet.rowUpdated</code>.
4137: * @param result set type, i.e. ResultSet.TYPE_XXX
4138: * @return <code>true</code> if changes are detected by the result set type
4139: * @exception SQLException if a database access error occurs
4140: */
4141: public boolean updatesAreDetected(int type) throws SQLException {
4142: if (dmd != null)
4143: return dmd.updatesAreDetected(type);
4144: else
4145: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4146: }
4147:
4148: /**
4149: * Indicates whether or not a visible row delete can be detected by
4150: * calling ResultSet.rowDeleted(). If deletesAreDetected()
4151: * returns false, then deleted rows are removed from the result set.
4152: * @param result set type, i.e. ResultSet.TYPE_XXX
4153: * @return true if changes are detected by the resultset type
4154: * @exception SQLException if a database access error occurs
4155: */
4156: public boolean deletesAreDetected(int type) throws SQLException {
4157: if (dmd != null)
4158: return dmd.deletesAreDetected(type);
4159: else
4160: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4161: }
4162:
4163: /**
4164: * Indicates whether or not a visible row insert can be detected
4165: * by calling ResultSet.rowInserted().
4166: * @param result set type, i.e. ResultSet.TYPE_XXX
4167: * @return true if changes are detected by the resultset type
4168: * @exception SQLException if a database access error occurs
4169: */
4170: public boolean insertsAreDetected(int type) throws SQLException {
4171: if (dmd != null)
4172: return dmd.insertsAreDetected(type);
4173: else
4174: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4175: }
4176:
4177: /**
4178: * Indicates whether the driver supports batch updates.
4179: * @return true if the driver supports batch updates
4180: */
4181: public boolean supportsBatchUpdates() throws SQLException {
4182: Boolean flag = (Boolean) properties.get(PROP_BATCH_UPDATES);
4183: if (flag == null) {
4184: if (dmd != null)
4185: try {
4186: flag = dmd.supportsBatchUpdates() ? Boolean.TRUE
4187: : Boolean.FALSE;
4188: } catch (AbstractMethodError exc) {
4189: //PENDING - unknown problem with AbstractMethodError
4190: //bug #27858 (http://db.netbeans.org/issues/show_bug.cgi?id=27858)
4191: }
4192: else
4193: throw new SQLException(bundle
4194: .getString("EXC_NoDBMetadata")); // NOI18N
4195: properties.put(PROP_BATCH_UPDATES, flag);
4196: }
4197:
4198: return flag.booleanValue();
4199: }
4200:
4201: public int getBatchUpdates() {
4202: return getBoolean(PROP_BATCH_UPDATES);
4203: }
4204:
4205: public void setBatchUpdates(int value) {
4206: setBoolean(PROP_BATCH_UPDATES, value);
4207: }
4208:
4209: /**
4210: * Gets a description of the user-defined types defined in a particular
4211: * schema. Schema-specific UDTs may have type JAVA_OBJECT, STRUCT,
4212: * or DISTINCT.
4213: */
4214: public ResultSet getUDTs(String catalog, String schemaPattern,
4215: String typeNamePattern, int[] types) throws SQLException {
4216: if (getCapitializeUsername() && schemaPattern != null)
4217: schemaPattern = schemaPattern.toUpperCase();
4218: String query = (String) properties.get(PROP_UDT_QUERY);
4219: if (query != null) {
4220: if (con != null) {
4221: StringBuffer typebuff = new StringBuffer();
4222: PreparedStatement stmt = con.prepareStatement(query);
4223: stmt.setString(1, catalog);
4224: stmt.setString(2, schemaPattern);
4225: stmt.setString(3, typeNamePattern);
4226:
4227: for (int i = 0; i < types.length; i++) {
4228: if (i > 0)
4229: typebuff.append(", ");
4230: typebuff.append(types[i]);
4231: }
4232:
4233: stmt.setString(4, typebuff.toString());
4234: return stmt.executeQuery();
4235: } else
4236: throw new SQLException(bundle
4237: .getString("EXC_NoConnection")); // NOI18N
4238: }
4239:
4240: if (dmd == null)
4241: throw new SQLException(bundle.getString("EXC_NoDBMetadata")); // NOI18N
4242: return dmd.getUDTs(catalog, schemaPattern, typeNamePattern,
4243: types);
4244: }
4245:
4246: public String getUDTsQuery() {
4247: return getString(PROP_UDT_QUERY);
4248: }
4249:
4250: public void setUDTsQuery(String value) {
4251: setString(PROP_UDT_QUERY, value);
4252: }
4253:
4254: // Extended properties
4255:
4256: public boolean getCapitializeUsername() {
4257: Boolean flag = (Boolean) properties.get("capitializeUsername");
4258: if (flag == null) {
4259: //flag = Boolean.TRUE;
4260: flag = Boolean.FALSE;
4261: properties.put("capitializeUsername", flag);
4262: }
4263: return flag.booleanValue();
4264: }
4265:
4266: public void setCapitializeUsername(boolean value) {
4267: Boolean newValue, oldValue = (Boolean) properties
4268: .get(PROP_CAPITALIZE_USERNAME);
4269: newValue = value ? Boolean.TRUE : Boolean.FALSE;
4270: properties.put(PROP_CAPITALIZE_USERNAME, newValue);
4271: propertySupport.firePropertyChange(PROP_CAPITALIZE_USERNAME,
4272: oldValue, newValue);
4273: }
4274:
4275: //JDK 1.4 / JDBC 3.0
4276: // workaround to be compilable under JDK 1.4
4277: // the following methods don't return real values
4278:
4279: public ResultSet getAttributes(String catalog,
4280: String schemaPattern, String typeNamePattern,
4281: String attributeNamePattern) throws SQLException {
4282: return null;
4283: }
4284:
4285: public int getDatabaseMajorVersion() throws SQLException {
4286: return dmd.getDatabaseMajorVersion();
4287: }
4288:
4289: public int getDatabaseMinorVersion() throws SQLException {
4290: return -1;
4291: }
4292:
4293: public int getJDBCMajorVersion() throws SQLException {
4294: return -1;
4295: }
4296:
4297: public int getJDBCMinorVersion() throws SQLException {
4298: return -1;
4299: }
4300:
4301: public int getResultSetHoldability() throws SQLException {
4302: return -1;
4303: }
4304:
4305: public int getSQLStateType() throws SQLException {
4306: return -1;
4307: }
4308:
4309: public ResultSet getSuperTables(String catalog,
4310: String schemaPattern, String tableNamePattern)
4311: throws SQLException {
4312: return null;
4313: }
4314:
4315: public ResultSet getSuperTypes(String catalog,
4316: String schemaPattern, String typeNamePattern)
4317: throws SQLException {
4318: return null;
4319: }
4320:
4321: public boolean locatorsUpdateCopy() throws SQLException {
4322: return false;
4323: }
4324:
4325: public boolean supportsGetGeneratedKeys() throws SQLException {
4326: return false;
4327: }
4328:
4329: public boolean supportsMultipleOpenResults() throws SQLException {
4330: return false;
4331: }
4332:
4333: public boolean supportsNamedParameters() throws SQLException {
4334: return false;
4335: }
4336:
4337: public boolean supportsResultSetHoldability(int holdability)
4338: throws SQLException {
4339: return false;
4340: }
4341:
4342: public boolean supportsSavepoints() throws SQLException {
4343: return false;
4344: }
4345:
4346: public boolean supportsStatementPooling() throws SQLException {
4347: return false;
4348: }
4349:
4350: //JDK 1.6 / JDBC 4.0
4351:
4352: public boolean supportsStoredFunctionsUsingCallSyntax()
4353: throws SQLException {
4354: return false;
4355: }
4356:
4357: public boolean isWrapperFor(Class clazz) {
4358: return false;
4359: }
4360:
4361: public Object unwrap(java.lang.Class iface)
4362: throws java.sql.SQLException {
4363: return null;
4364: }
4365:
4366: public java.sql.RowIdLifetime getRowIdLifetime()
4367: throws SQLException {
4368: return null;
4369: }
4370:
4371: public ResultSet getSchemas(String catalog, String schemaPattern)
4372: throws SQLException {
4373: return null;
4374: }
4375:
4376: public ResultSet getClientInfoProperties() throws SQLException {
4377: return null;
4378: }
4379:
4380: public ResultSet getFunctionColumns(String catalog,
4381: String schemaPattern, String functionNamePattern,
4382: String columnNamePattern) throws SQLException {
4383: return null;
4384: }
4385:
4386: public ResultSet getFunctions(String catalog, String schemaPattern,
4387: String functionNamePattern) throws SQLException {
4388: return null;
4389: }
4390:
4391: public boolean providesQueryObjectGenerator() throws SQLException {
4392: return false;
4393: }
4394:
4395: public boolean autoCommitFailureClosesAllResultSets()
4396: throws SQLException {
4397: return false;
4398: }
4399: }
|