0001: package org.mandarax.jdbc;
0002:
0003: /*
0004: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
0005: *
0006: * This library is free software; you can redistribute it and/or
0007: * modify it under the terms of the GNU Lesser General Public
0008: * License as published by the Free Software Foundation; either
0009: * version 2 of the License, or (at your option) any later version.
0010: *
0011: * This library is distributed in the hope that it will be useful,
0012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0014: * Lesser General Public License for more details.
0015: *
0016: * You should have received a copy of the GNU Lesser General Public
0017: * License along with this library; if not, write to the Free Software
0018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0019: */
0020:
0021: import java.util.*;
0022: import java.sql.*;
0023: import org.mandarax.util.regex.WildcardMatcher;
0024:
0025: /**
0026: * Abstract superclass for database meta data implementations.
0027: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
0028: * @version 3.3.2 <29 December 2004>
0029: * @since 3.0
0030: */
0031:
0032: public abstract class AbstractDatabaseMetaDataImpl implements
0033: DatabaseMetaData {
0034: // constants
0035: public static final String DEFAULT_CATALOG = "main";
0036: public static final String DEFAULT_SCHEMA = "default";
0037: public static final String PREDICATE_TABLE_TYPE = "PREDICATE";
0038: public static WildcardMatcher matcher = WildcardMatcher.DB_INSTANCE;
0039: public static final int VARCHAR = Types.VARCHAR;
0040: public static final int SMALLINT = Types.SMALLINT;
0041:
0042: private String url = null;
0043: private Connection connection = null;
0044:
0045: /**
0046: * Constructor.
0047: * @param url the database url
0048: * @param connection the connection used to produce this object
0049: */
0050: public AbstractDatabaseMetaDataImpl(String url,
0051: Connection connection) {
0052: super ();
0053: this .url = url;
0054: this .connection = connection;
0055: }
0056:
0057: /**
0058: * Retrieves whether the current user can call all the procedures returned by the method getProcedures.
0059: * @return boolean
0060: * @throws java.sql.SQLException
0061: */
0062: public boolean allProceduresAreCallable() throws SQLException {
0063: return false;
0064: }
0065:
0066: /**
0067: * Retrieves whether the current user can use all the tables returned by the method getTables in a SELECT statement.
0068: * @return boolean
0069: * @throws java.sql.SQLException
0070: */
0071: public boolean allTablesAreSelectable() throws SQLException {
0072: return true;
0073: }
0074:
0075: /**
0076: * Retrieves the URL for this DBMS.
0077: * @return the url of the db
0078: * @throws java.sql.SQLException
0079: * @see java.sql.DatabaseMetaData#getURL()
0080: */
0081: public String getURL() throws SQLException {
0082: return url;
0083: }
0084:
0085: /**
0086: * Retrieves the user name as known to this database.
0087: * @return java.lang.String
0088: * @throws java.sql.SQLException
0089: */
0090: public String getUserName() throws SQLException {
0091: return "default";
0092: }
0093:
0094: /**
0095: * Retrieves whether this database is in read-only mode.
0096: * @return boolean
0097: * @throws java.sql.SQLException
0098: */
0099: public boolean isReadOnly() throws SQLException {
0100: return true;
0101: }
0102:
0103: /**
0104: * Retrieves whether NULL values are sorted high. Sorted high means that NULL values sort higher
0105: * than any other value in a domain. In an ascending order, if this method returns true, NULL
0106: * values will appear at the end. By contrast, the method nullsAreSortedAtEnd indicates whether
0107: * NULL values are sorted at the end regardless of sort order.
0108: * @return boolean
0109: * @throws java.sql.SQLException
0110: */
0111: public boolean nullsAreSortedHigh() throws SQLException {
0112: return false;
0113: }
0114:
0115: /**
0116: * Retrieves whether NULL values are sorted low. Sorted low means that NULL values sort lower
0117: * than any other value in a domain. In an ascending order, if this method returns true, NULL
0118: * values will appear at the beginning. By contrast, the method nullsAreSortedAtStart indicates
0119: * whether NULL values are sorted at the beginning regardless of sort order.
0120: * @return boolean
0121: * @throws java.sql.SQLException
0122: */
0123: public boolean nullsAreSortedLow() throws SQLException {
0124: return false;
0125: }
0126:
0127: /**
0128: * Retrieves whether NULL values are sorted at the start regardless of sort order.
0129: * @return boolean
0130: * @throws java.sql.SQLException
0131: */
0132: public boolean nullsAreSortedAtStart() throws SQLException {
0133: return false;
0134: }
0135:
0136: /**
0137: * Retrieves whether NULL values are sorted at the end regardless of sort order.
0138: * @return boolean
0139: * @throws java.sql.SQLException
0140: */
0141: public boolean nullsAreSortedAtEnd() throws SQLException {
0142: return false;
0143:
0144: }
0145:
0146: /**
0147: * Retrieves the name of this database product.
0148: * @return database product name
0149: * @throws java.sql.SQLException
0150: */
0151: public String getDatabaseProductName() throws SQLException {
0152: return "Mandarax";
0153:
0154: }
0155:
0156: /**
0157: * Retrieves the version number of this database product.
0158: * @return database version number
0159: * @throws java.sql.SQLException
0160: */
0161: public String getDatabaseProductVersion() throws SQLException {
0162: return "3.0";
0163: }
0164:
0165: /**
0166: * Retrieves the version number of this JDBC driver as a String.
0167: * @return JDBC driver version
0168: * @throws java.sql.SQLException
0169: */
0170: public String getDriverVersion() throws SQLException {
0171: return "" + getDatabaseMajorVersion() + '.'
0172: + getDriverMinorVersion();
0173:
0174: }
0175:
0176: /**
0177: * Retrieves whether this database uses a file for each table.
0178: * @return boolean
0179: * @throws java.sql.SQLException
0180: */
0181: public boolean usesLocalFilePerTable() throws SQLException {
0182: return false;
0183:
0184: }
0185:
0186: /**
0187: * Retrieves whether this database treats mixed case unquoted SQL identifiers as
0188: * case insensitive and stores them in mixed case.
0189: * @return boolean
0190: * @throws java.sql.SQLException
0191: * @see java.sql.DatabaseMetaData#supportsMixedCaseIdentifiers()
0192: */
0193: public boolean supportsMixedCaseIdentifiers() throws SQLException {
0194: return false;
0195: }
0196:
0197: /**
0198: * Retrieves whether this database treats mixed case unquoted SQL identifiers
0199: * as case insensitive and stores them in upper case.
0200: * @return boolean
0201: * @throws java.sql.SQLException
0202: */
0203: public boolean storesUpperCaseIdentifiers() throws SQLException {
0204: return true;
0205: }
0206:
0207: /**
0208: * Retrieves whether this database treats mixed case unquoted SQL
0209: * identifiers as case insensitive and stores them in lower case.
0210: * @return boolean
0211: * @throws java.sql.SQLException
0212: * @see java.sql.DatabaseMetaData#storesLowerCaseIdentifiers()
0213: */
0214: public boolean storesLowerCaseIdentifiers() throws SQLException {
0215: return false;
0216: }
0217:
0218: /**
0219: * Retrieves whether this database treats mixed case unquoted SQL
0220: * identifiers as case sensitive and as a result stores them in mixed case.
0221: * @return boolean
0222: * @throws java.sql.SQLException
0223: */
0224: public boolean storesMixedCaseIdentifiers() throws SQLException {
0225: return false;
0226: }
0227:
0228: /**
0229: * Retrieves whether this database treats mixed case quoted SQL identifiers as case
0230: * sensitive and as a result stores them in mixed case.
0231: * @return boolean
0232: * @throws java.sql.SQLException
0233: */
0234: public boolean supportsMixedCaseQuotedIdentifiers()
0235: throws SQLException {
0236: return false;
0237: }
0238:
0239: /**
0240: * Retrieves whether this database treats mixed case quoted SQL identifiers as case
0241: * insensitive and stores them in upper case.
0242: * @return boolean
0243: * @throws java.sql.SQLException
0244: */
0245: public boolean storesUpperCaseQuotedIdentifiers()
0246: throws SQLException {
0247: return false;
0248: }
0249:
0250: /**
0251: * Retrieves whether this database treats mixed case quoted SQL identifiers as case
0252: * insensitive and stores them in lower case.
0253: * @return boolean
0254: * @throws java.sql.SQLException
0255: */
0256: public boolean storesLowerCaseQuotedIdentifiers()
0257: throws SQLException {
0258: return false;
0259:
0260: }
0261:
0262: /**
0263: * Retrieves whether this database treats mixed case quoted SQL identifiers
0264: * as case sensitive and as a result stores them in mixed case.
0265: * @return boolean
0266: * @throws java.sql.SQLException
0267: */
0268: public boolean storesMixedCaseQuotedIdentifiers()
0269: throws SQLException {
0270: return false;
0271: }
0272:
0273: /**
0274: * Retrieves the string used to quote SQL identifiers.
0275: * This method returns a space " " if identifier quoting is not supported.
0276: * @return java.lang.String
0277: * @throws java.sql.SQLException
0278: */
0279: public String getIdentifierQuoteString() throws SQLException {
0280: return " ";
0281: }
0282:
0283: /**
0284: * Retrieves a comma-separated list of all of this database's SQL keywords that are
0285: * NOT also SQL92 keywords.
0286: * @return java.lang.String
0287: * @throws java.sql.SQLException
0288: */
0289: public String getSQLKeywords() throws SQLException {
0290: return "";
0291: }
0292:
0293: /**
0294: * Retrieves a comma-separated list of math functions available with this database.
0295: * These are the Open /Open CLI math function names used in the JDBC function escape clause.
0296: * @return java.lang.String
0297: * @throws java.sql.SQLException
0298: */
0299: public String getNumericFunctions() throws SQLException {
0300: return "";
0301: }
0302:
0303: /**
0304: * Retrieves a comma-separated list of string functions available with this database.
0305: * These are the Open Group CLI string function names used in the JDBC function escape clause.
0306: * @return java.lang.String
0307: * @throws java.sql.SQLException
0308: */
0309: public String getStringFunctions() throws SQLException {
0310: return "";
0311: }
0312:
0313: /**
0314: * Retrieves a comma-separated list of system functions available with this database.
0315: * These are the Open Group CLI system function names used in the JDBC function escape clause.
0316: * @return java.lang.String
0317: * @throws java.sql.SQLException
0318: */
0319: public String getSystemFunctions() throws SQLException {
0320: return "";
0321: }
0322:
0323: /**
0324: * Retrieves a comma-separated list of the time and date functions available with this database.
0325: * @return java.lang.String
0326: * @throws java.sql.SQLException
0327: */
0328: public String getTimeDateFunctions() throws SQLException {
0329: return "";
0330: }
0331:
0332: /**
0333: * Retrieves the string that can be used to escape wildcard characters. This is the string that can
0334: * be used to escape '_' or '%' in the catalog search parameters that are a pattern
0335: * (and therefore use one of the wildcard characters).
0336: * @return java.lang.String
0337: * @throws java.sql.SQLException
0338: */
0339: public String getSearchStringEscape() throws SQLException {
0340: return "\\";
0341: }
0342:
0343: /**
0344: * Retrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
0345: * @return java.lang.String
0346: * @throws java.sql.SQLException
0347: */
0348: public String getExtraNameCharacters() throws SQLException {
0349: return "";
0350: }
0351:
0352: /**
0353: * Retrieves whether this database supports ALTER TABLE with add column.
0354: * @return boolean
0355: * @throws java.sql.SQLException
0356: */
0357: public boolean supportsAlterTableWithAddColumn()
0358: throws SQLException {
0359: return false;
0360:
0361: }
0362:
0363: /**
0364: * Retrieves whether this database supports ALTER TABLE with drop column.
0365: * @return boolean
0366: * @throws java.sql.SQLException
0367: * @see java.sql.DatabaseMetaData#supportsAlterTableWithDropColumn()
0368: */
0369: public boolean supportsAlterTableWithDropColumn()
0370: throws SQLException {
0371: return false;
0372:
0373: }
0374:
0375: /**
0376: * Retrieves whether this database supports column aliasing.
0377: * @return boolean
0378: * @throws java.sql.SQLException
0379: */
0380: public boolean supportsColumnAliasing() throws SQLException {
0381: return false;
0382: }
0383:
0384: /**
0385: * Retrieves whether this database supports concatenations between NULL
0386: * and non-NULL values being NULL.
0387: * @return boolean
0388: * @throws java.sql.SQLException
0389: */
0390: public boolean nullPlusNonNullIsNull() throws SQLException {
0391: return false;
0392: }
0393:
0394: /**
0395: * Retrieves whether this database supports the CONVERT function between SQL types.
0396: * @return boolean
0397: * @throws java.sql.SQLException
0398: */
0399: public boolean supportsConvert() throws SQLException {
0400: return false;
0401: }
0402:
0403: /**
0404: * Retrieves whether this database supports the CONVERT for two given SQL types.
0405: * @param fromType the type to convert from; one of the type codes from the class java.sql.Types
0406: * @param toType the type to convert to; one of the type codes from the class java.sql.Types
0407: * @return boolean
0408: * @throws java.sql.SQLException
0409: */
0410: public boolean supportsConvert(int fromType, int toType)
0411: throws SQLException {
0412: return false;
0413: }
0414:
0415: /**
0416: * Retrieves whether this database supports table correlation names.
0417: * @return boolean
0418: * @throws java.sql.SQLException
0419: */
0420: public boolean supportsTableCorrelationNames() throws SQLException {
0421: return true;
0422: }
0423:
0424: /**
0425: * Retrieves whether, when table correlation names are supported, they are restricted
0426: * to being different from the names of the tables.
0427: * @return boolean
0428: * @throws java.sql.SQLException
0429: */
0430: public boolean supportsDifferentTableCorrelationNames()
0431: throws SQLException {
0432: return false;
0433: }
0434:
0435: /**
0436: * Retrieves whether this database supports expressions in ORDER BY lists.
0437: * Aggregation functions in ORDER BY lists are supported!
0438: * @return boolean
0439: * @throws java.sql.SQLException
0440: */
0441: public boolean supportsExpressionsInOrderBy() throws SQLException {
0442: return true;
0443: }
0444:
0445: /**
0446: * Retrieves whether this database supports using a column that is not
0447: * in the SELECT statement in an ORDER BY clause.
0448: * @return boolean
0449: * @throws java.sql.SQLException
0450: */
0451: public boolean supportsOrderByUnrelated() throws SQLException {
0452: return true;
0453: }
0454:
0455: /**
0456: * Retrieves whether this database supports some form of GROUP BY clause.
0457: * @return boolean
0458: * @throws java.sql.SQLException
0459: */
0460: public boolean supportsGroupBy() throws SQLException {
0461: return true;
0462: }
0463:
0464: /**
0465: * Retrieves whether this database supports using a column that is not in the
0466: * SELECT statement in a GROUP BY clause.
0467: * @return boolean
0468: * @throws java.sql.SQLException
0469: */
0470: public boolean supportsGroupByUnrelated() throws SQLException {
0471: return true;
0472: }
0473:
0474: /**
0475: * Retrieves whether this database supports using columns not included
0476: * in the SELECT statement in a GROUP BY clause provided that all of the
0477: * columns in the SELECT statement are included in the GROUP BY clause.
0478: * @return boolean
0479: * @throws java.sql.SQLException
0480: */
0481: public boolean supportsGroupByBeyondSelect() throws SQLException {
0482: return true;
0483: }
0484:
0485: /**
0486: * Retrieves whether this database supports specifying a LIKE escape clause.
0487: * @return boolean
0488: * @throws java.sql.SQLException
0489: * @see java.sql.DatabaseMetaData#supportsLikeEscapeClause()
0490: */
0491: public boolean supportsLikeEscapeClause() throws SQLException {
0492: return true;
0493: }
0494:
0495: /**
0496: * Retrieves whether this database supports getting multiple ResultSet
0497: * objects from a single call to the method execute.
0498: * @return boolean
0499: * @throws java.sql.SQLException
0500: */
0501: public boolean supportsMultipleResultSets() throws SQLException {
0502: return false;
0503: }
0504:
0505: /**
0506: * Retrieves whether this database allows having multiple transactions
0507: * open at once (on different connections).
0508: * @return boolean
0509: * @throws java.sql.SQLException
0510: */
0511: public boolean supportsMultipleTransactions() throws SQLException {
0512: return false;
0513: }
0514:
0515: /**
0516: * Retrieves whether columns in this database may be defined as non-nullable.
0517: * @return boolean
0518: * @throws java.sql.SQLException
0519: */
0520: public boolean supportsNonNullableColumns() throws SQLException {
0521: return true;
0522: }
0523:
0524: /**
0525: * Retrieves whether this database supports the ODBC Minimum SQL grammar.
0526: * @return boolean
0527: * @throws java.sql.SQLException
0528: */
0529: public boolean supportsMinimumSQLGrammar() throws SQLException {
0530: return false;
0531: }
0532:
0533: /**
0534: * Retrieves whether this database supports the ODBC Core SQL grammar.
0535: * @return boolean
0536: * @throws java.sql.SQLException
0537: */
0538: public boolean supportsCoreSQLGrammar() throws SQLException {
0539: return false;
0540: }
0541:
0542: /**
0543: * Retrieves whether this database supports the ODBC Extended SQL grammar.
0544: * @return boolean
0545: * @throws java.sql.SQLException
0546: */
0547: public boolean supportsExtendedSQLGrammar() throws SQLException {
0548: return false;
0549: }
0550:
0551: /**
0552: * Retrieves whether this database supports the ANSI92 entry level SQL grammar.
0553: * @return boolean
0554: * @throws java.sql.SQLException
0555: */
0556: public boolean supportsANSI92EntryLevelSQL() throws SQLException {
0557: return false;
0558: }
0559:
0560: /**
0561: * Retrieves whether this database supports the ANSI92 intermediate SQL grammar supported.
0562: * @return boolean
0563: * @throws java.sql.SQLException
0564: */
0565: public boolean supportsANSI92IntermediateSQL() throws SQLException {
0566: return false;
0567: }
0568:
0569: /**
0570: * Retrieves whether this database supports the ANSI92 full SQL grammar supported.
0571: * @return boolean
0572: * @throws java.sql.SQLException
0573: */
0574: public boolean supportsANSI92FullSQL() throws SQLException {
0575: return false;
0576: }
0577:
0578: /**
0579: * Retrieves whether this database supports the SQL Integrity Enhancement Facility.
0580: * @return boolean
0581: * @throws java.sql.SQLException
0582: */
0583: public boolean supportsIntegrityEnhancementFacility()
0584: throws SQLException {
0585: return false;
0586: }
0587:
0588: /**
0589: * Retrieves whether this database supports some form of outer join.
0590: * @return boolean
0591: * @throws java.sql.SQLException
0592: */
0593: public boolean supportsOuterJoins() throws SQLException {
0594: return false;
0595: }
0596:
0597: /**
0598: * Retrieves whether this database supports full nested outer joins.
0599: * @return boolean
0600: * @throws java.sql.SQLException
0601: */
0602: public boolean supportsFullOuterJoins() throws SQLException {
0603: return false;
0604: }
0605:
0606: /**
0607: * Retrieves whether this database provides limited support for outer joins.
0608: * @return boolean
0609: * @throws java.sql.SQLException
0610: * @see java.sql.DatabaseMetaData#supportsLimitedOuterJoins()
0611: */
0612: public boolean supportsLimitedOuterJoins() throws SQLException {
0613: return false;
0614: }
0615:
0616: /**
0617: * Retrieves the database vendor's preferred term for "schema".
0618: * @return java.lang.String
0619: * @throws java.sql.SQLException
0620: */
0621: public String getSchemaTerm() throws SQLException {
0622: return "knowledge base";
0623: }
0624:
0625: /**
0626: * Retrieves the database vendor's preferred term for "procedure".
0627: * @return java.lang.String
0628: * @throws java.sql.SQLException
0629: */
0630: public String getProcedureTerm() throws SQLException {
0631: return "procedure";
0632: }
0633:
0634: /**
0635: * Retrieves the database vendor's preferred term for "catalog".
0636: * @return java.lang.String
0637: * @throws java.sql.SQLException
0638: */
0639: public String getCatalogTerm() throws SQLException {
0640: return "catalog";
0641: }
0642:
0643: /**
0644: * Retrieves whether a catalog appears at the start of a fully qualified table name.
0645: * @return boolean
0646: * @throws java.sql.SQLException
0647: */
0648: public boolean isCatalogAtStart() throws SQLException {
0649: return false;
0650: }
0651:
0652: /**
0653: * Retrieves the String that this database uses as the separator between a catalog and table name.
0654: * @return java.lang.String
0655: * @throws java.sql.SQLException
0656: */
0657: public String getCatalogSeparator() throws SQLException {
0658: return ".";
0659: }
0660:
0661: /**
0662: * Retrieves whether a schema name can be used in a data manipulation statement.
0663: * @return boolean
0664: * @throws java.sql.SQLException
0665: */
0666: public boolean supportsSchemasInDataManipulation()
0667: throws SQLException {
0668: return false;
0669: }
0670:
0671: /**
0672: * Retrieves whether a schema name can be used in a procedure call statement.
0673: * @return boolean
0674: * @throws java.sql.SQLException
0675: */
0676: public boolean supportsSchemasInProcedureCalls()
0677: throws SQLException {
0678: return false;
0679: }
0680:
0681: /**
0682: * Retrieves whether a schema name can be used in a table definition statement.
0683: * @return boolean
0684: * @throws java.sql.SQLException
0685: */
0686: public boolean supportsSchemasInTableDefinitions()
0687: throws SQLException {
0688: return false;
0689: }
0690:
0691: /**
0692: * Retrieves whether a schema name can be used in an index definition statement.
0693: * @return boolean
0694: * @throws java.sql.SQLException
0695: */
0696: public boolean supportsSchemasInIndexDefinitions()
0697: throws SQLException {
0698: return false;
0699: }
0700:
0701: /**
0702: * Retrieves whether a schema name can be used in a privilege definition statement.
0703: * @return boolean
0704: * @throws java.sql.SQLException
0705: */
0706: public boolean supportsSchemasInPrivilegeDefinitions()
0707: throws SQLException {
0708: return false;
0709: }
0710:
0711: /**
0712: * Retrieves whether a catalog name can be used in a data manipulation statement.
0713: * @return boolean
0714: * @throws java.sql.SQLException
0715: */
0716: public boolean supportsCatalogsInDataManipulation()
0717: throws SQLException {
0718: return false;
0719:
0720: }
0721:
0722: /**
0723: * Retrieves whether a catalog name can be used in a procedure call statement.
0724: * @return boolean
0725: * @throws java.sql.SQLException
0726: */
0727: public boolean supportsCatalogsInProcedureCalls()
0728: throws SQLException {
0729: return false;
0730: }
0731:
0732: /**
0733: * Retrieves whether a catalog name can be used in a table definition statement.
0734: * @return boolean
0735: * @throws java.sql.SQLException
0736: */
0737: public boolean supportsCatalogsInTableDefinitions()
0738: throws SQLException {
0739: return false;
0740: }
0741:
0742: /**
0743: * Retrieves whether a catalog name can be used in an index definition statement.
0744: * @return boolean
0745: * @throws java.sql.SQLException
0746: */
0747: public boolean supportsCatalogsInIndexDefinitions()
0748: throws SQLException {
0749: return false;
0750: }
0751:
0752: /**
0753: * Retrieves whether a catalog name can be used in a privilege definition statement.
0754: * @return boolean
0755: * @throws java.sql.SQLException
0756: */
0757: public boolean supportsCatalogsInPrivilegeDefinitions()
0758: throws SQLException {
0759: return false;
0760: }
0761:
0762: /**
0763: * Retrieves whether this database supports positioned DELETE statements.
0764: * @return boolean
0765: * @throws java.sql.SQLException
0766: */
0767: public boolean supportsPositionedDelete() throws SQLException {
0768: return false;
0769: }
0770:
0771: /**
0772: * Retrieves whether this database supports positioned UPDATE statements.
0773: * @return boolean
0774: * @throws java.sql.SQLException
0775: */
0776: public boolean supportsPositionedUpdate() throws SQLException {
0777: return false;
0778: }
0779:
0780: /**
0781: * Retrieves whether this database supports SELECT FOR UPDATE statements.
0782: * @return boolean
0783: * @throws java.sql.SQLException
0784: */
0785: public boolean supportsSelectForUpdate() throws SQLException {
0786: return false;
0787: }
0788:
0789: /**
0790: * Retrieves whether this database supports stored procedure calls that use
0791: * the stored procedure escape syntax.
0792: * @return boolean
0793: * @throws java.sql.SQLException
0794: */
0795: public boolean supportsStoredProcedures() throws SQLException {
0796: return false;
0797: }
0798:
0799: /**
0800: * Retrieves whether this database supports subqueries in comparison expressions.
0801: * @return boolean
0802: * @throws java.sql.SQLException
0803: */
0804: public boolean supportsSubqueriesInComparisons()
0805: throws SQLException {
0806: return false;
0807: }
0808:
0809: /**
0810: * Retrieves whether this database supports subqueries in EXISTS expressions.
0811: * @return boolean
0812: * @throws java.sql.SQLException
0813: */
0814: public boolean supportsSubqueriesInExists() throws SQLException {
0815: return false;
0816: }
0817:
0818: /**
0819: * Retrieves whether this database supports subqueries in IN statements.
0820: * @return boolean
0821: * @throws java.sql.SQLException
0822: */
0823: public boolean supportsSubqueriesInIns() throws SQLException {
0824: return false;
0825: }
0826:
0827: /**
0828: * Retrieves whether this database supports subqueries in quantified expressions.
0829: * @return boolean
0830: * @throws java.sql.SQLException
0831: */
0832: public boolean supportsSubqueriesInQuantifieds()
0833: throws SQLException {
0834: return false;
0835: }
0836:
0837: /**
0838: * Retrieves whether this database supports correlated subqueries.
0839: * @return boolean
0840: * @throws java.sql.SQLException
0841: */
0842: public boolean supportsCorrelatedSubqueries() throws SQLException {
0843: return false;
0844: }
0845:
0846: /**
0847: * Retrieves whether this database supports SQL UNION.
0848: * @return boolean
0849: * @throws java.sql.SQLException
0850: * @see java.sql.DatabaseMetaData#supportsUnion()
0851: */
0852: public boolean supportsUnion() throws SQLException {
0853: return false;
0854: }
0855:
0856: /**
0857: * Retrieves whether this database supports SQL UNION ALL.
0858: * @return boolean
0859: * @throws java.sql.SQLException
0860: */
0861: public boolean supportsUnionAll() throws SQLException {
0862: return false;
0863: }
0864:
0865: /**
0866: * Retrieves whether this database supports keeping cursors open across commits.
0867: * @return boolean
0868: * @throws java.sql.SQLException
0869: */
0870: public boolean supportsOpenCursorsAcrossCommit()
0871: throws SQLException {
0872: return false;
0873: }
0874:
0875: /**
0876: * Retrieves whether this database supports keeping cursors open across rollbacks.
0877: * @return boolean
0878: * @throws java.sql.SQLException
0879: */
0880: public boolean supportsOpenCursorsAcrossRollback()
0881: throws SQLException {
0882: return false;
0883: }
0884:
0885: /**
0886: * Retrieves whether this database supports keeping statements open across commits.
0887: * @return boolean
0888: * @throws java.sql.SQLException
0889: */
0890: public boolean supportsOpenStatementsAcrossCommit()
0891: throws SQLException {
0892: return false;
0893: }
0894:
0895: /**
0896: * Retrieves whether this database supports keeping statements open across rollbacks.
0897: * @return boolean
0898: * @throws java.sql.SQLException
0899: */
0900: public boolean supportsOpenStatementsAcrossRollback()
0901: throws SQLException {
0902: return false;
0903: }
0904:
0905: /**
0906: * Retrieves the maximum number of hex characters this database allows in an inline binary literal.
0907: * @return int
0908: * @throws java.sql.SQLException
0909: */
0910: public int getMaxBinaryLiteralLength() throws SQLException {
0911: return 0;
0912: }
0913:
0914: /**
0915: * Retrieves the maximum number of characters this database allows for a character literal.
0916: * @return int
0917: * @throws java.sql.SQLException
0918: */
0919: public int getMaxCharLiteralLength() throws SQLException {
0920: return 0;
0921: }
0922:
0923: /**
0924: * Retrieves the maximum number of characters this database allows for a column name.
0925: * @return int
0926: * @throws java.sql.SQLException
0927: */
0928: public int getMaxColumnNameLength() throws SQLException {
0929: return 0;
0930: }
0931:
0932: /**
0933: * Retrieves the maximum number of columns this database allows in a GROUP BY clause.
0934: * @return int
0935: * @throws java.sql.SQLException
0936: */
0937: public int getMaxColumnsInGroupBy() throws SQLException {
0938: return 0;
0939: }
0940:
0941: /**
0942: * Retrieves the maximum number of columns this database allows in an index.
0943: * @return int
0944: * @throws java.sql.SQLException
0945: */
0946: public int getMaxColumnsInIndex() throws SQLException {
0947: return 0;
0948: }
0949:
0950: /**
0951: * Retrieves the maximum number of columns this database allows in an ORDER BY clause.
0952: * @return int
0953: * @throws java.sql.SQLException
0954: */
0955: public int getMaxColumnsInOrderBy() throws SQLException {
0956: return 0;
0957: }
0958:
0959: /**
0960: * Retrieves the maximum number of columns this database allows in a SELECT list.
0961: * @return int
0962: * @throws java.sql.SQLException
0963: */
0964: public int getMaxColumnsInSelect() throws SQLException {
0965: return 0;
0966:
0967: }
0968:
0969: /**
0970: * Retrieves the maximum number of columns this database allows in a table.
0971: * @return int
0972: * @throws java.sql.SQLException
0973: */
0974: public int getMaxColumnsInTable() throws SQLException {
0975: return 0;
0976: }
0977:
0978: /**
0979: * Retrieves the maximum number of concurrent connections to this database that are possible.
0980: * @return int
0981: * @throws java.sql.SQLException
0982: */
0983: public int getMaxConnections() throws SQLException {
0984: return 0;
0985: }
0986:
0987: /**
0988: * Retrieves the maximum number of characters that this database allows in a cursor name.
0989: * @return int
0990: * @throws java.sql.SQLException
0991: */
0992: public int getMaxCursorNameLength() throws SQLException {
0993: return 0;
0994: }
0995:
0996: /**
0997: * Retrieves the maximum number of bytes this database allows for an index,
0998: * including all of the parts of the index.
0999: * @return int
1000: * @throws java.sql.SQLException
1001: */
1002: public int getMaxIndexLength() throws SQLException {
1003: return 0;
1004: }
1005:
1006: /**
1007: * Retrieves the maximum number of characters that this database allows in a schema name.
1008: * @return int
1009: * @throws java.sql.SQLException
1010: */
1011: public int getMaxSchemaNameLength() throws SQLException {
1012: return 0;
1013: }
1014:
1015: /**
1016: * Retrieves the maximum number of characters that this database allows in a procedure name.
1017: * @return int
1018: * @throws java.sql.SQLException
1019: */
1020: public int getMaxProcedureNameLength() throws SQLException {
1021: return 0;
1022: }
1023:
1024: /**
1025: * Retrieves the maximum number of characters that this database allows in a catalog name.
1026: * @return int
1027: * @throws java.sql.SQLException
1028: */
1029: public int getMaxCatalogNameLength() throws SQLException {
1030: return 0;
1031: }
1032:
1033: /**
1034: * Retrieves the maximum number of bytes this database allows in a single row.
1035: * @return int
1036: * @throws java.sql.SQLException
1037: */
1038: public int getMaxRowSize() throws SQLException {
1039: return 0;
1040: }
1041:
1042: /**
1043: * Retrieves whether the return value for the method getMaxRowSize includes
1044: * the SQL data types LONGVARCHAR and LONGVARBINARY.
1045: * @return boolean
1046: * @throws java.sql.SQLException
1047: */
1048: public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
1049: return true;
1050: }
1051:
1052: /**
1053: * Retrieves the maximum number of characters this database allows in an SQL statement.
1054: * @return int
1055: * @throws java.sql.SQLException
1056: */
1057: public int getMaxStatementLength() throws SQLException {
1058: return 0;
1059: }
1060:
1061: /**
1062: * Retrieves the maximum number of active statements to this database that can be open at the same time.
1063: * @return int
1064: * @throws java.sql.SQLException
1065: */
1066: public int getMaxStatements() throws SQLException {
1067: return 0;
1068: }
1069:
1070: /**
1071: * Retrieves the maximum number of characters this database allows in a table name.
1072: * @return int
1073: * @throws java.sql.SQLException
1074: */
1075: public int getMaxTableNameLength() throws SQLException {
1076: return 0;
1077: }
1078:
1079: /**
1080: * Retrieves the maximum number of tables this database allows in a SELECT statement.
1081: * @return int
1082: * @throws java.sql.SQLException
1083: */
1084: public int getMaxTablesInSelect() throws SQLException {
1085: return 1;
1086: }
1087:
1088: /**
1089: * Retrieves the maximum number of characters this database allows in a user name.
1090: * @return int
1091: * @throws java.sql.SQLException
1092: */
1093: public int getMaxUserNameLength() throws SQLException {
1094: return 0;
1095: }
1096:
1097: /**
1098: * Retrieves this database's default transaction isolation level.
1099: * The possible values are defined in java.sql.Connection.
1100: * @return int
1101: * @throws java.sql.SQLException
1102: */
1103: public int getDefaultTransactionIsolation() throws SQLException {
1104: return Connection.TRANSACTION_NONE;
1105: }
1106:
1107: /**
1108: * Retrieves whether this database supports transactions.
1109: * If not, invoking the method commit is a noop, and the isolation level is TRANSACTION_NONE.
1110: * @return boolean
1111: * @throws java.sql.SQLException
1112: */
1113: public boolean supportsTransactions() throws SQLException {
1114: return false;
1115: }
1116:
1117: /**
1118: * Retrieves whether this database supports the given transaction isolation level.
1119: * @param level
1120: * @return boolean
1121: * @throws java.sql.SQLException
1122: */
1123: public boolean supportsTransactionIsolationLevel(int level)
1124: throws SQLException {
1125: return level == Connection.TRANSACTION_NONE;
1126: }
1127:
1128: /**
1129: * Retrieves whether this database supports both data definition and data manipulation statements within a transaction.
1130: * @return boolean
1131: * @throws java.sql.SQLException
1132: */
1133: public boolean supportsDataDefinitionAndDataManipulationTransactions()
1134: throws SQLException {
1135: return false;
1136: }
1137:
1138: /**
1139: * Retrieves whether this database supports only data manipulation statements within a transaction.
1140: * @return boolean
1141: * @throws java.sql.SQLException
1142: */
1143: public boolean supportsDataManipulationTransactionsOnly()
1144: throws SQLException {
1145: return false;
1146: }
1147:
1148: /**
1149: * Retrieves whether a data definition statement within a transaction forces the transaction to commit.
1150: * @return boolean
1151: * @throws java.sql.SQLException
1152: */
1153: public boolean dataDefinitionCausesTransactionCommit()
1154: throws SQLException {
1155: return false;
1156: }
1157:
1158: /**
1159: * Retrieves whether this database ignores a data definition statement within a transaction.
1160: * @return boolean
1161: * @throws java.sql.SQLException
1162: */
1163: public boolean dataDefinitionIgnoredInTransactions()
1164: throws SQLException {
1165: return false;
1166: }
1167:
1168: /**
1169: * Retrieves a description of the stored procedures available in the given catalog.
1170: * @param catalog
1171: * @param schemaPattern
1172: * @param procedureNamePattern
1173: * @return java.sql.ResultSet
1174: * @throws java.sql.SQLException
1175: */
1176: public ResultSet getProcedures(String catalog,
1177: String schemaPattern, String procedureNamePattern)
1178: throws SQLException {
1179: return StaticResultSet.getEmptyResultSet(new String[] {
1180: "PROCEDURE_CAT", "PROCEDURE_SCHEM", "PROCEDURE_NAME",
1181: "REMARKS", "PROCEDURE_TYPE" });
1182: }
1183:
1184: /**
1185: * Retrieves a description of the given catalog's stored procedure parameter and result columns.
1186: * @param catalog
1187: * @param schemaPattern
1188: * @param procedureNamePattern
1189: * @param columnNamePattern
1190: * @return java.sql.ResultSet
1191: * @throws java.sql.SQLException
1192: */
1193: public ResultSet getProcedureColumns(String catalog,
1194: String schemaPattern, String procedureNamePattern,
1195: String columnNamePattern) throws SQLException {
1196: return StaticResultSet.getEmptyResultSet(new String[] {
1197: "PROCEDURE_CAT", "PROCEDURE_SCHEM", "PROCEDURE_NAME",
1198: "COLUMN_NAME", "COLUMN_TYPE", "DATA_TYPE", "TYPE_NAME",
1199: "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE",
1200: "REMARKS" });
1201: }
1202:
1203: /**
1204: * Retrieves the schema names available in this database. The results are ordered by schema name.
1205: * @return java.sql.ResultSet
1206: * @throws java.sql.SQLException
1207: */
1208: public ResultSet getSchemas() throws SQLException {
1209: final List all = new ArrayList();
1210: List schemas = new ArrayList();
1211: schemas.add(DEFAULT_SCHEMA);
1212: schemas.add(DEFAULT_CATALOG);
1213: all.add(schemas);
1214: return new StaticResultSet(new String[] { "TABLE_SCHEM",
1215: "TABLE_CATALOG" }, all);
1216: }
1217:
1218: /**
1219: * Retrieves the catalog names available in this database.
1220: * The results are ordered by catalog name.
1221: * @return java.sql.ResultSet
1222: * @throws java.sql.SQLException
1223: */
1224: public ResultSet getCatalogs() throws SQLException {
1225: final List all = new ArrayList();
1226: List catalogs = new ArrayList();
1227: catalogs.add(DEFAULT_CATALOG);
1228: all.add(catalogs);
1229: return new StaticResultSet(new String[] { "TABLE_CAT" }, all);
1230: }
1231:
1232: /**
1233: * Retrieves the table types available in this database. The results are ordered by table type.
1234: * @return java.sql.ResultSet
1235: * @throws java.sql.SQLException
1236: */
1237: public ResultSet getTableTypes() throws SQLException {
1238: final List all = new ArrayList();
1239: List types = new ArrayList();
1240: types.add(PREDICATE_TABLE_TYPE);
1241: all.add(types);
1242: return new StaticResultSet(new String[] { "TABLE_TYPE" }, all);
1243: }
1244:
1245: /**
1246: * Retrieves a description of the access rights for a table's columns.
1247: * @param catalog
1248: * @param schema
1249: * @param table
1250: * @param columnNamePattern
1251: * @return java.sql.ResultSet
1252: * @throws java.sql.SQLException
1253: */
1254: public ResultSet getColumnPrivileges(String catalog, String schema,
1255: String table, String columnNamePattern) throws SQLException {
1256: return StaticResultSet.getEmptyResultSet(new String[] {
1257: "TABLE_CAT String", "TABLE_SCHEM", "TABLE_NAME",
1258: "COLUMN_NAME", "GRANTOR", "GRANTEE", "PRIVILEGE",
1259: "IS_GRANTABLE" });
1260: }
1261:
1262: /**
1263: * Retrieves a description of the access rights for each table available in a catalog.
1264: * @param catalog
1265: * @param schemaPattern
1266: * @param tableNamePattern
1267: * @return java.sql.ResultSet
1268: * @throws java.sql.SQLException
1269: */
1270: public ResultSet getTablePrivileges(String catalog,
1271: String schemaPattern, String tableNamePattern)
1272: throws SQLException {
1273: return StaticResultSet.getEmptyResultSet(new String[] {
1274: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "GRANTOR",
1275: "GRANTEE", "PRIVILEGE", "IS_GRANTABLE" });
1276: }
1277:
1278: /**
1279: * Retrieves a description of a table's optimal set of columns that uniquely identifies a row.
1280: * @param catalog
1281: * @param schema
1282: * @param table
1283: * @param scope
1284: * @param nullable
1285: * @return java.sql.ResultSet
1286: * @throws java.sql.SQLException
1287: * @see java.sql.DatabaseMetaData#getBestRowIdentifier(java.lang.String, java.lang.String, java.lang.String, int, boolean)
1288: */
1289: public ResultSet getBestRowIdentifier(String catalog,
1290: String schema, String table, int scope, boolean nullable)
1291: throws SQLException {
1292: return StaticResultSet.getEmptyResultSet(new String[] {
1293: "SCOPE", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME",
1294: "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS",
1295: "PSEUDO_COLUMN" });
1296: }
1297:
1298: /**
1299: * Retrieves a description of a table's columns that are automatically updated when any value in a row is updated.
1300: * @param catalog
1301: * @param schema
1302: * @param table
1303: * @return java.sql.ResultSet
1304: * @throws java.sql.SQLException
1305: * @see java.sql.DatabaseMetaData#getVersionColumns(java.lang.String, java.lang.String, java.lang.String)
1306: */
1307: public ResultSet getVersionColumns(String catalog, String schema,
1308: String table) throws SQLException {
1309: return StaticResultSet.getEmptyResultSet(new String[] {
1310: "SCOPE", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME",
1311: "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS",
1312: "PSEUDO_COLUMN" });
1313: }
1314:
1315: /**
1316: * Retrieves a description of the given table's primary key columns.
1317: * @param catalog
1318: * @param schema
1319: * @param table
1320: * @return java.sql.ResultSet
1321: * @throws java.sql.SQLException
1322: * @see java.sql.DatabaseMetaData#getPrimaryKeys(java.lang.String, java.lang.String, java.lang.String)
1323: */
1324: public ResultSet getPrimaryKeys(String catalog, String schema,
1325: String table) throws SQLException {
1326: return StaticResultSet.getEmptyResultSet(new String[] {
1327: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME",
1328: "COLUMN_NAME", "KEY_SEQ", "PK_NAME" });
1329: }
1330:
1331: /**
1332: * Retrieves a description of the primary key columns that are referenced by a table's foreign key columns
1333: * (the primary keys imported by a table).
1334: * @param catalog
1335: * @param schema
1336: * @param table
1337: * @return java.sql.ResultSet
1338: * @throws java.sql.SQLException
1339: * @see java.sql.DatabaseMetaData#getImportedKeys(java.lang.String, java.lang.String, java.lang.String)
1340: */
1341: public ResultSet getImportedKeys(String catalog, String schema,
1342: String table) throws SQLException {
1343: return StaticResultSet.getEmptyResultSet(new String[] {
1344: "PKTABLE_CAT", "PKTABLE_SCHEM", "PKTABLE_NAME",
1345: "PKCOLUMN_NAME", "FKTABLE_CAT", "FKTABLE_SCHEM",
1346: "FKTABLE_NAME", "FKCOLUMN_NAME", "KEY_SEQ",
1347: "UPDATE_RULE", "DELETE_RULE", "FK_NAME", "PK_NAME",
1348: "DEFERRABILITY" });
1349: }
1350:
1351: /**
1352: * Retrieves a description of the foreign key columns that reference the given table's primary key columns.
1353: * @param catalog
1354: * @param schema
1355: * @param table
1356: * @return java.sql.ResultSet
1357: * @throws java.sql.SQLException
1358: * @see java.sql.DatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String, java.lang.String)
1359: */
1360: public ResultSet getExportedKeys(String catalog, String schema,
1361: String table) throws SQLException {
1362: return StaticResultSet.getEmptyResultSet(new String[] {
1363: "PKTABLE_CAT", "PKTABLE_SCHEM", "PKTABLE_NAME",
1364: "PKCOLUMN_NAME", "FKTABLE_CAT", "FKTABLE_SCHEM",
1365: "FKTABLE_NAME", "FKCOLUMN_NAME", "KEY_SEQ",
1366: "UPDATE_RULE", "DELETE_RULE", "FK_NAME", "PK_NAME",
1367: "DEFERRABILITY" });
1368: }
1369:
1370: /**
1371: * Retrieves a description of the foreign key columns in the given foreign key table that
1372: * reference the primary key columns of the given primary key table.
1373: * @param primaryCatalog
1374: * @param primarySchema
1375: * @param primaryTable
1376: * @param foreignCatalog
1377: * @param foreignSchema
1378: * @param foreignTable
1379: * @return java.sql.ResultSet
1380: * @throws java.sql.SQLException
1381: * @see java.sql.DatabaseMetaData#getCrossReference(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
1382: */
1383: public ResultSet getCrossReference(String primaryCatalog,
1384: String primarySchema, String primaryTable,
1385: String foreignCatalog, String foreignSchema,
1386: String foreignTable) throws SQLException {
1387: return StaticResultSet.getEmptyResultSet(new String[] {
1388: "PKTABLE_CAT", "PKTABLE_SCHEM", "PKTABLE_NAME",
1389: "PKCOLUMN_NAME", "FKTABLE_CAT", "FKTABLE_SCHEM",
1390: "FKTABLE_NAME", "FKCOLUMN_NAME", "KEY_SEQ",
1391: "UPDATE_RULE", "DELETE_RULE", "FK_NAME", "PK_NAME",
1392: "DEFERRABILITY" });
1393: }
1394:
1395: /**
1396: * Retrieves a description of all the standard SQL types supported by this database.
1397: * @return java.sql.ResultSet
1398: * @throws java.sql.SQLException
1399: */
1400: public ResultSet getTypeInfo() throws SQLException {
1401: return StaticResultSet.getEmptyResultSet(new String[] {
1402: "TYPE_NAME", "DATA_TYPE", "PRECISION",
1403: "LITERAL_PREFIX", "LITERAL_SUFFIX", "CREATE_PARAMS",
1404: "NULLABLE", "CASE_SENSITIVE", "SEARCHABLE",
1405: "UNSIGNED_ATTRIBUTE", "FIXED_PREC_SCALE",
1406: "AUTO_INCREMENT", "LOCAL_TYPE_NAME", "MINIMUM_SCALE",
1407: "MAXIMUM_SCALE", "SQL_DATA_TYPE", "SQL_DATETIME_SUB",
1408: "NUM_PREC_RADIX" });
1409: }
1410:
1411: /**
1412: * Retrieves a description of the given table's indices and statistics.
1413: * They are ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
1414: * @param catalog
1415: * @param schema
1416: * @param table
1417: * @param unique
1418: * @param approximate
1419: * @return java.sql.ResultSet
1420: * @throws java.sql.SQLException
1421: */
1422: public ResultSet getIndexInfo(String catalog, String schema,
1423: String table, boolean unique, boolean approximate)
1424: throws SQLException {
1425: return StaticResultSet.getEmptyResultSet(new String[] {
1426: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "NON_UNIQUE",
1427: "INDEX_QUALIFIER", "INDEX_NAME", "TYPE",
1428: "ORDINAL_POSITION", "COLUMN_NAME", "ASC_OR_DESC",
1429: "CARDINALITY", "PAGES", "FILTER_CONDITION" });
1430: }
1431:
1432: /**
1433: * Retrieves whether this database supports the given result set type.
1434: * @param type
1435: * @return boolean
1436: * @throws java.sql.SQLException
1437: */
1438: public boolean supportsResultSetType(int type) throws SQLException {
1439: return ResultSet.TYPE_FORWARD_ONLY == type
1440: || ResultSet.TYPE_SCROLL_INSENSITIVE == type;
1441: }
1442:
1443: /**
1444: * Retrieves whether this database supports the given concurrency type in combination with the given result set type.
1445: * @param type
1446: * @param concurrency
1447: * @return boolean
1448: * @throws java.sql.SQLException
1449: */
1450: public boolean supportsResultSetConcurrency(int type,
1451: int concurrency) throws SQLException {
1452: return concurrency == ResultSet.CONCUR_READ_ONLY
1453: && (ResultSet.TYPE_FORWARD_ONLY == type || ResultSet.TYPE_SCROLL_INSENSITIVE == type);
1454: }
1455:
1456: /**
1457: * Retrieves whether for the given type of ResultSet object, the result set's own updates are visible.
1458: * @param type
1459: * @return boolean
1460: * @throws java.sql.SQLException
1461: */
1462: public boolean ownUpdatesAreVisible(int type) throws SQLException {
1463: return false;
1464: }
1465:
1466: /**
1467: * Retrieves whether a result set's own deletes are visible.
1468: * @param type
1469: * @return boolean
1470: * @throws java.sql.SQLException
1471: */
1472: public boolean ownDeletesAreVisible(int type) throws SQLException {
1473: return false;
1474: }
1475:
1476: /**
1477: * Retrieves whether a result set's own inserts are visible.
1478: * @param type
1479: * @return boolean
1480: * @throws java.sql.SQLException
1481: */
1482: public boolean ownInsertsAreVisible(int type) throws SQLException {
1483: return false;
1484: }
1485:
1486: /**
1487: * Retrieves whether updates made by others are visible.
1488: * @param type
1489: * @return boolean
1490: * @throws java.sql.SQLException
1491: */
1492: public boolean othersUpdatesAreVisible(int type)
1493: throws SQLException {
1494: return false;
1495: }
1496:
1497: /**
1498: * Retrieves whether deletes made by others are visible.
1499: * @param type
1500: * @return boolean
1501: * @throws java.sql.SQLException
1502: */
1503: public boolean othersDeletesAreVisible(int type)
1504: throws SQLException {
1505: return false;
1506: }
1507:
1508: /**
1509: * Retrieves whether inserts made by others are visible.
1510: * @param type
1511: * @return boolean
1512: * @throws java.sql.SQLException
1513: */
1514: public boolean othersInsertsAreVisible(int type)
1515: throws SQLException {
1516: return false;
1517: }
1518:
1519: /**
1520: * Retrieves whether or not a visible row update can be detected by calling
1521: * the method ResultSet.rowUpdated.
1522: * @param type
1523: * @return boolean
1524: * @throws java.sql.SQLException
1525: */
1526: public boolean updatesAreDetected(int type) throws SQLException {
1527: return false;
1528: }
1529:
1530: /**
1531: * Retrieves whether or not a visible row delete can be detected by calling
1532: * the method ResultSet.rowDeleted.
1533: * Always returns false - this is a read only driver!
1534: * (The return value does not really matter - attempts to delete rows from
1535: * the result set shall fail).
1536: * @see org.mandarax.jdbc.ResultSetImpl#deleteRow()
1537: * @param type
1538: * @return false
1539: * @throws java.sql.SQLException
1540: */
1541: public boolean deletesAreDetected(int type) throws SQLException {
1542: return false;
1543:
1544: }
1545:
1546: /**
1547: * Retrieves whether or not a visible row insert can be detected by
1548: * calling the method ResultSet.rowInserted.
1549: * Always returns false - this is a read only driver!
1550: * (The return value does not really matter - attempts to delete rows from
1551: * the result set shall fail).
1552: * @see org.mandarax.jdbc.ResultSetImpl#insertRow()
1553: * @param type
1554: * @return false
1555: * @throws java.sql.SQLException
1556: */
1557: public boolean insertsAreDetected(int type) throws SQLException {
1558: return false;
1559: }
1560:
1561: /**
1562: * Retrieves whether this database supports batch updates.
1563: * @return false
1564: * @throws java.sql.SQLException
1565: * @see java.sql.DatabaseMetaData#supportsBatchUpdates()
1566: */
1567: public boolean supportsBatchUpdates() throws SQLException {
1568: return false;
1569:
1570: }
1571:
1572: /**
1573: * Retrieves a description of the user-defined types (UDTs) defined in a particular schema.
1574: * @param catalog
1575: * @param schemaPattern
1576: * @param typeNamePattern
1577: * @param types
1578: * @return java.sql.ResultSet
1579: * @throws java.sql.SQLException
1580: */
1581: public ResultSet getUDTs(String catalog, String schemaPattern,
1582: String typeNamePattern, int[] types) throws SQLException {
1583: return StaticResultSet.getEmptyResultSet(new String[] {
1584: "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "CLASS_NAME",
1585: "DATA_TYPE", "REMARKS", "BASE_TYPE" });
1586: }
1587:
1588: /**
1589: *
1590: * @return java.sql.Connection
1591: * @throws java.sql.SQLException
1592: * @see java.sql.DatabaseMetaData#getConnection()
1593: */
1594: public Connection getConnection() throws SQLException {
1595: return connection;
1596: }
1597:
1598: /**
1599: * Retrieves whether this database supports savepoints.
1600: * @return boolean
1601: * @throws java.sql.SQLException
1602: */
1603: public boolean supportsSavepoints() throws SQLException {
1604: return false;
1605: }
1606:
1607: /**
1608: * Retrieves whether this database supports named parameters to callable statements.
1609: * @return boolean
1610: * @throws java.sql.SQLException
1611: */
1612: public boolean supportsNamedParameters() throws SQLException {
1613: return false;
1614: }
1615:
1616: /**
1617: * Retrieves whether it is possible to have multiple ResultSet objects returned from a CallableStatement object simultaneously.
1618: * @return boolean
1619: * @throws java.sql.SQLException
1620: */
1621: public boolean supportsMultipleOpenResults() throws SQLException {
1622: return false;
1623: }
1624:
1625: /**
1626: * Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
1627: * @return boolean
1628: * @throws java.sql.SQLException
1629: */
1630: public boolean supportsGetGeneratedKeys() throws SQLException {
1631: return false;
1632: }
1633:
1634: /**
1635: * Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema
1636: * in this database. Only the immediate super type/ sub type relationship is modeled.
1637: * @param catalog
1638: * @param schemaPattern
1639: * @param typeNamePattern
1640: * @return java.sql.ResultSet
1641: * @throws java.sql.SQLException
1642: */
1643: public ResultSet getSuperTypes(String catalog,
1644: String schemaPattern, String typeNamePattern)
1645: throws SQLException {
1646: return StaticResultSet.getEmptyResultSet(new String[] {
1647: "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SUPERTYPE_CAT",
1648: "SUPERTYPE_SCHEM", "SUPERTYPE_NAME" });
1649: }
1650:
1651: /**
1652: * Retrieves a description of the table hierarchies defined in a particular schema in this database.
1653: * @param catalog
1654: * @param schemaPattern
1655: * @param tableNamePattern
1656: * @return java.sql.ResultSet
1657: * @throws java.sql.SQLException
1658: */
1659: public ResultSet getSuperTables(String catalog,
1660: String schemaPattern, String tableNamePattern)
1661: throws SQLException {
1662: return StaticResultSet.getEmptyResultSet(new String[] {
1663: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME",
1664: "SUPERTABLE_NAME" });
1665: }
1666:
1667: /**
1668: * Retrieves a description of the given attribute of the given type for a user-defined type (UDT)
1669: * that is available in the given schema and catalog.
1670: * @param catalog
1671: * @param schemaPattern
1672: * @param typeNamePattern
1673: * @param attributeNamePattern
1674: * @return java.sql.ResultSet
1675: * @throws java.sql.SQLException
1676: */
1677: public ResultSet getAttributes(String catalog,
1678: String schemaPattern, String typeNamePattern,
1679: String attributeNamePattern) throws SQLException {
1680: return StaticResultSet.getEmptyResultSet(new String[] {
1681: "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "ATTR_NAME",
1682: "DATA_TYPE", "ATTR_TYPE_NAME", "ATTR_SIZE",
1683: "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE",
1684: "REMARKS", "ATTR_DEF", "SQL_DATA_TYPE",
1685: "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
1686: "ORDINAL_POSITION", "IS_NULLABLE String",
1687: "SCOPE_CATALOG", "SCOPE_SCHEMA", "SCOPE_TABLE",
1688: "SOURCE_DATA_TYPE" });
1689: }
1690:
1691: /**
1692: * Retrieves whether this database supports the given result set holdability.
1693: * @param holdability
1694: * @return boolean
1695: * @throws java.sql.SQLException
1696: * @see java.sql.DatabaseMetaData#supportsResultSetHoldability(int)
1697: */
1698: public boolean supportsResultSetHoldability(int holdability)
1699: throws SQLException {
1700: return false;
1701: }
1702:
1703: /**
1704: * Retrieves the default holdability of this ResultSet object.
1705: * @return int
1706: * @throws java.sql.SQLException
1707: */
1708: public int getResultSetHoldability() throws SQLException {
1709: return ResultSet.CLOSE_CURSORS_AT_COMMIT;
1710: }
1711:
1712: /**
1713: * Retrieves the major version number of the underlying database.
1714: * @return int
1715: * @throws java.sql.SQLException
1716: */
1717: public int getDatabaseMajorVersion() throws SQLException {
1718: return 3;
1719: }
1720:
1721: /**
1722: * Retrieves the minor version number of the underlying database.
1723: * @return int
1724: * @throws java.sql.SQLException
1725: * @see java.sql.DatabaseMetaData#getDatabaseMinorVersion()
1726: */
1727: public int getDatabaseMinorVersion() throws SQLException {
1728: return 0;
1729: }
1730:
1731: /**
1732: * Retrieves the major JDBC version number for this driver.
1733: * @return int
1734: * @throws java.sql.SQLException
1735: */
1736: public int getJDBCMajorVersion() throws SQLException {
1737: return this .getDatabaseMajorVersion();
1738: }
1739:
1740: /**
1741: * Retrieves the minor JDBC version number for this driver.
1742: * @return int
1743: * @throws java.sql.SQLException
1744: */
1745: public int getJDBCMinorVersion() throws SQLException {
1746: return this .getDatabaseMinorVersion();
1747: }
1748:
1749: /**
1750: * Indicates whether the SQLSTATEs returned by SQLException.getSQLState is X/Open (now known as Open Group) SQL CLI or SQL99.
1751: * @return int
1752: * @throws java.sql.SQLException
1753: */
1754: public int getSQLStateType() throws SQLException {
1755: return -1;
1756: }
1757:
1758: /**
1759: * Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
1760: * @return boolean
1761: * @throws java.sql.SQLException
1762: */
1763: public boolean locatorsUpdateCopy() throws SQLException {
1764: return false;
1765: }
1766:
1767: /**
1768: * Indicates whether statement pooling is supported.
1769: * @return boolean
1770: * @throws java.sql.SQLException
1771: */
1772: public boolean supportsStatementPooling() throws SQLException {
1773: return false;
1774: }
1775:
1776: /**
1777: * Check catalog and schema name pattern.
1778: * @param catalog
1779: * @param schemaPattern
1780: * @return a boolean
1781: */
1782: protected boolean checkCatalogAndSchema(String catalog,
1783: String schemaPattern) {
1784: boolean result = true;
1785: result = catalog == null || DEFAULT_CATALOG.equals(catalog);
1786: result = schemaPattern == null
1787: || WildcardMatcher.DB_INSTANCE.matches(schemaPattern,
1788: DEFAULT_SCHEMA);
1789: return result;
1790: }
1791:
1792: /**
1793: * Check the table types.
1794: * @param types an array of types
1795: * @return true if predicate is one of those types
1796: */
1797: protected boolean checkTableTypes(String[] types) {
1798: if (types == null)
1799: return true;
1800: for (int i = 0; i < types.length; i++) {
1801: if (PREDICATE_TABLE_TYPE.equals(types[i]))
1802: return true;
1803: }
1804: return false;
1805: }
1806:
1807: }
|