Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

DatabaseMetaData.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2002-2004 French National Institute For Research In Computer
00004  * Science And Control (INRIA).
00005  * Contact: c-jdbc@objectweb.org
00006  * 
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published by the
00009  * Free Software Foundation; either version 2.1 of the License, or any later
00010  * version.
00011  * 
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00015  * for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00020  *
00021  * Initial developer(s): Emmanuel Cecchet.
00022  * Contributor(s): Jean-Bernard van Zuylen
00023  */
00024 
00025 package org.objectweb.cjdbc.driver;
00026 
00027 import java.sql.SQLException;
00028 import java.util.HashMap;
00029 
00030 import org.objectweb.cjdbc.common.sql.NotImplementedException;
00031 import org.objectweb.cjdbc.common.sql.metadata.MetadataContainer;
00032 import org.objectweb.cjdbc.common.sql.metadata.MetadataDescription;
00033 import org.objectweb.cjdbc.common.util.Constants;
00034 
00035 /**
00036  * DatabaseMetaData retrieves most of the values from the C-JDBC controller. If
00037  * you are using an heterogeneous cluster, the values returned are the one of
00038  * the first database that was enabled on the controller.
00039  * 
00040  * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
00041  * @author <a href="mailto:jbvanzuylen@transwide.com">Jean-Bernard van Zuylen
00042  *         </a>
00043  * @version 1.0
00044  */
00045 public class DatabaseMetaData implements java.sql.DatabaseMetaData
00046 {
00047   /** The connection association */
00048   private Connection connection;
00049 
00050   /**
00051    * Metadata container
00052    */
00053   private HashMap    metadataContainer;
00054 
00055   /**
00056    * Creates a new <code>DatabaseMetaData</code> instance.
00057    * 
00058    * @param conn a <code>Connection</code> value
00059    */
00060   public DatabaseMetaData(Connection conn)
00061   {
00062     this.connection = conn;
00063     metadataContainer = new HashMap();
00064   }
00065 
00066   /**
00067    * Lazy evaluation of static metadata. If the value is in the list, we return
00068    * it. Else we get it from the controller. <br>
00069    * 
00070    * @param methodName metadata method name
00071    * @param parametersType parameters type of method to invoke
00072    * @param arguments arguments to invoke the method
00073    * @param allowsNull true if a null metadata can be returned, if set to false
00074    *          an exception will be thrown if the metadata is null
00075    * @return the value returned by the given method
00076    * @throws SQLException if the connection fails
00077    */
00078   private Object getMetadata(String methodName, Class[] parametersType,
00079       Object[] arguments, boolean allowsNull) throws SQLException
00080   {
00081     String key = MetadataContainer.getContainerKey(methodName,
00082         parametersType, arguments);
00083     Object value = metadataContainer.get(key);
00084 
00085     if (value == null)
00086     { // Value not yet in container
00087       value = connection.getStaticMetadata(key);
00088       if ((value == null) && !allowsNull)
00089         throw new SQLException("Unable to retrieve metadata for " + key);
00090       metadataContainer.put(key, value);
00091     }
00092     return value;
00093   }
00094 
00095   /**
00096    * @see java.sql.DatabaseMetaData#allProceduresAreCallable()
00097    */
00098   public boolean allProceduresAreCallable() throws SQLException
00099   {
00100     return ((Boolean) getMetadata(
00101         MetadataDescription.ALL_PROCEDURES_ARE_CALLABLE, null, null, false))
00102         .booleanValue();
00103   }
00104 
00105   /**
00106    * @see java.sql.DatabaseMetaData#allTablesAreSelectable()
00107    */
00108   public boolean allTablesAreSelectable() throws SQLException
00109   {
00110     return ((Boolean) getMetadata(
00111         MetadataDescription.ALL_TABLES_ARE_SELECTABLE, null, null, false))
00112         .booleanValue();
00113   }
00114 
00115   /**
00116    * @see java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()
00117    */
00118   public boolean dataDefinitionCausesTransactionCommit() throws SQLException
00119   {
00120     return ((Boolean) getMetadata(
00121         MetadataDescription.DATA_DEFINITION_CAUSES_TRANSACTION_COMMIT, null,
00122         null, false)).booleanValue();
00123   }
00124 
00125   /**
00126    * @see java.sql.DatabaseMetaData#dataDefinitionIgnoredInTransactions()
00127    */
00128   public boolean dataDefinitionIgnoredInTransactions() throws SQLException
00129   {
00130     return ((Boolean) getMetadata(
00131         MetadataDescription.DATA_DEFINITION_IGNORED_IN_TRANSACTIONS, null,
00132         null, false)).booleanValue();
00133   }
00134 
00135   /**
00136    * @see java.sql.DatabaseMetaData#deletesAreDetected(int)
00137    */
00138   public boolean deletesAreDetected(int type) throws SQLException
00139   {
00140     return ((Boolean) getMetadata(MetadataDescription.DELETES_ARE_DETECTED,
00141         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00142         .booleanValue();
00143   }
00144 
00145   /**
00146    * @see java.sql.DatabaseMetaData#doesMaxRowSizeIncludeBlobs()
00147    */
00148   public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
00149   {
00150     return ((Boolean) getMetadata(
00151         MetadataDescription.DOES_MAX_ROW_SIZE_INCLUDE_BLOBS, null, null, false))
00152         .booleanValue();
00153   }
00154 
00155   /**
00156    * This method is currently not supported and returns <code>null</code>. It
00157    * could be forwarded to the Controller but it is not clear that the result
00158    * would be the same for heterogeneous databases.
00159    * 
00160    * @param catalog a catalog name; "" retrieves those without a catalog
00161    * @param schema a schema name; "" retrieves those without a schema
00162    * @param table a table name
00163    * @param scope the scope of interest; use same values as SCOPE
00164    * @param nullable include columns that are nullable?
00165    * @return <code>ResultSet</code> each row is a column description
00166    * @exception SQLException if an error occurs
00167    */
00168   public java.sql.ResultSet getBestRowIdentifier(String catalog, String schema,
00169       String table, int scope, boolean nullable) throws SQLException
00170   {
00171     return null;
00172   }
00173 
00174   /**
00175    * @see java.sql.DatabaseMetaData#getCatalogs()
00176    */
00177   public java.sql.ResultSet getCatalogs() throws SQLException
00178   {
00179     return connection.getCatalogs();
00180   }
00181 
00182   /**
00183    * @see java.sql.DatabaseMetaData#getCatalogSeparator()
00184    */
00185   public String getCatalogSeparator() throws SQLException
00186   {
00187     return ((String) getMetadata(MetadataDescription.GET_CATALOG_SEPARATOR,
00188         null, null, true));
00189   }
00190 
00191   /**
00192    * @see java.sql.DatabaseMetaData#getCatalogTerm()
00193    */
00194   public String getCatalogTerm() throws SQLException
00195   {
00196     return ((String) getMetadata(MetadataDescription.GET_CATALOG_TERM, null,
00197         null, true));
00198   }
00199 
00200   /**
00201    * @param catalog a catalog name; "" retrieves those without a catalog
00202    * @param schemaPattern a schema name pattern; "" retrieves those without a
00203    *          schema
00204    * @param tableNamePattern a table name pattern
00205    * @param columnNamePattern a column name pattern
00206    * @return <code>null</code>
00207    * @exception SQLException if an error occurs
00208    * @see #getSearchStringEscape
00209    */
00210   public java.sql.ResultSet getColumns(String catalog, String schemaPattern,
00211       String tableNamePattern, String columnNamePattern) throws SQLException
00212   {
00213     return connection.getColumns(catalog, schemaPattern, tableNamePattern,
00214         columnNamePattern);
00215   }
00216 
00217   /**
00218    * Feature not yet supported by C-JDBC.
00219    * 
00220    * @param catalog a catalog name; "" retrieves those without a catalog
00221    * @param schemaPattern a schema name pattern; "" retrieves those without a
00222    *          schema
00223    * @param tableNamePattern a table name pattern
00224    * @param columnNamePattern a column name pattern
00225    * @return <code>null</code>
00226    * @exception SQLException if an error occurs
00227    * @see #getSearchStringEscape
00228    */
00229   public java.sql.ResultSet getColumnPrivileges(String catalog,
00230       String schemaPattern, String tableNamePattern, String columnNamePattern)
00231       throws SQLException
00232   {
00233     return null;
00234   }
00235 
00236   /**
00237    * Retrieves the <code>Connection</code> that produced this
00238    * <code>DatabaseMetaData</code>.
00239    * 
00240    * @return the <code>Connection</code> object
00241    * @exception SQLException if an error occurs
00242    */
00243   public java.sql.Connection getConnection() throws SQLException
00244   {
00245     return connection;
00246   }
00247 
00248   /**
00249    * Feature not yet supported by C-JDBC
00250    * 
00251    * @param primaryCatalog a <code>String</code> value
00252    * @param primarySchema a <code>String</code> value
00253    * @param primaryTable a <code>String</code> value
00254    * @param foreignCatalog a <code>String</code> value
00255    * @param foreignSchema a <code>String</code> value
00256    * @param foreignTable a <code>String</code> value
00257    * @return <code>null</code>
00258    * @exception SQLException if an error occurs
00259    * @see #getImportedKeys
00260    */
00261   public java.sql.ResultSet getCrossReference(String primaryCatalog,
00262       String primarySchema, String primaryTable, String foreignCatalog,
00263       String foreignSchema, String foreignTable) throws SQLException
00264   {
00265     return null;
00266   }
00267 
00268   /**
00269    * We return a comma separated list of database engine names connected to the
00270    * controller. A name appears only once regardless of the number of instances
00271    * of this particular db engine. If no database product name is provided by
00272    * the backend drivers, default is to return "C-JDBC Controller".
00273    * 
00274    * @return comma separated list of database product names
00275    * @exception SQLException if a database access error occurs
00276    */
00277   public String getDatabaseProductName() throws SQLException
00278   {
00279     return connection.getDatabaseProductName();
00280   }
00281 
00282   /**
00283    * What is the version of this database product.
00284    * 
00285    * @return the C-JDBC driver version
00286    * @exception SQLException if an error occurs
00287    */
00288   public String getDatabaseProductVersion() throws SQLException
00289   {
00290     return connection.getControllerVersionNumber();
00291   }
00292 
00293   /**
00294    * @see java.sql.DatabaseMetaData#getDefaultTransactionIsolation()
00295    */
00296   public int getDefaultTransactionIsolation() throws SQLException
00297   {
00298     return ((Integer) getMetadata(
00299         MetadataDescription.GET_DEFAULT_TRANSACTION_ISOLATION, null, null,
00300         false)).intValue();
00301   }
00302 
00303   /**
00304    * What is this JDBC driver's major version number?
00305    * 
00306    * @return the JDBC driver major version
00307    */
00308   public int getDriverMajorVersion()
00309   {
00310     return Driver.MAJOR_VERSION;
00311   }
00312 
00313   /**
00314    * What is this JDBC driver's minor version number?
00315    * 
00316    * @return the JDBC driver minor version
00317    */
00318   public int getDriverMinorVersion()
00319   {
00320     return Driver.MINOR_VERSION;
00321   }
00322 
00323   /**
00324    * What is the name of this JDBC driver?
00325    * 
00326    * @return the JDBC driver name
00327    * @exception SQLException why?
00328    */
00329   public String getDriverName() throws SQLException
00330   {
00331     return "C-JDBC Generic Driver";
00332   }
00333 
00334   /**
00335    * What is the version string of this JDBC driver?
00336    * 
00337    * @return the JDBC driver name.
00338    * @exception SQLException why?
00339    */
00340   public String getDriverVersion() throws SQLException
00341   {
00342     return Constants.VERSION;
00343   }
00344 
00345   /**
00346    * Feature not yet supported by C-JDBC.
00347    * 
00348    * @param catalog a catalog name; "" retrieves those without a catalog
00349    * @param schema a schema name pattern; "" retrieves those without a schema
00350    * @param table a table name
00351    * @return <code>null</code>
00352    * @exception SQLException why?
00353    * @see #getExportedKeys
00354    */
00355   public java.sql.ResultSet getExportedKeys(String catalog, String schema,
00356       String table) throws SQLException
00357   {
00358     return null;
00359   }
00360 
00361   /**
00362    * @see java.sql.DatabaseMetaData#getExtraNameCharacters()
00363    */
00364   public String getExtraNameCharacters() throws SQLException
00365   {
00366     return ((String) getMetadata(MetadataDescription.GET_EXTRA_NAME_CHARACTERS,
00367         null, null, true));
00368   }
00369 
00370   /**
00371    * @see java.sql.DatabaseMetaData#getIdentifierQuoteString()
00372    */
00373   public String getIdentifierQuoteString() throws SQLException
00374   {
00375     return ((String) getMetadata(
00376         MetadataDescription.GET_IDENTIFIER_QUOTE_STRING, null, null, true));
00377   }
00378 
00379   /**
00380    * Feature not yet supported by C-JDBC.
00381    * 
00382    * @param catalog a catalog name; "" retrieves those without a catalog
00383    * @param schema a schema name pattern; "" retrieves those without a schema
00384    * @param table a table name
00385    * @return <code>null</code>
00386    * @exception SQLException if a database access error occurs
00387    * @see #getExportedKeys
00388    */
00389   public java.sql.ResultSet getImportedKeys(String catalog, String schema,
00390       String table) throws SQLException
00391   {
00392     return null;
00393   }
00394 
00395   /**
00396    * Feature not yet supported by C-JDBC.
00397    * 
00398    * @param catalog a catalog name; "" retrieves those without a catalog
00399    * @param schema a schema name pattern; "" retrieves those without a schema
00400    * @param table a table name
00401    * @param unique when <code>true</code>, return only indices for unique
00402    *          values; when <code>false</code>, return indices regardless of
00403    *          whether unique or not
00404    * @param approximate when <code>true</code>, result is allowed to reflect
00405    *          approximate or out of data values; when <code>false</code>,
00406    *          results are requested to be accurate
00407    * @return <code>Empty ResultSet</code>
00408    * @exception SQLException if a database access error occurs
00409    */
00410   public java.sql.ResultSet getIndexInfo(String catalog, String schema,
00411       String table, boolean unique, boolean approximate) throws SQLException
00412   {
00413     return new DriverResultSet(new Field[0], null);
00414   }
00415 
00416   /**
00417    * @see java.sql.DatabaseMetaData#getMaxBinaryLiteralLength()
00418    */
00419   public int getMaxBinaryLiteralLength() throws SQLException
00420   {
00421     return ((Integer) getMetadata(
00422         MetadataDescription.GET_MAX_BINARY_LITERAL_LENGTH, null, null, false))
00423         .intValue();
00424 
00425   }
00426 
00427   /**
00428    * @see java.sql.DatabaseMetaData#getMaxCatalogNameLength()
00429    */
00430   public int getMaxCatalogNameLength() throws SQLException
00431   {
00432     return ((Integer) getMetadata(
00433         MetadataDescription.GET_MAX_CATALOG_NAME_LENGTH, null, null, false))
00434         .intValue();
00435   }
00436 
00437   /**
00438    * @see java.sql.DatabaseMetaData#getMaxCharLiteralLength()
00439    */
00440   public int getMaxCharLiteralLength() throws SQLException
00441   {
00442     return ((Integer) getMetadata(
00443         MetadataDescription.GET_MAX_CHAR_LITERAL_LENGTH, null, null, false))
00444         .intValue();
00445   }
00446 
00447   /**
00448    * @see java.sql.DatabaseMetaData#getMaxColumnNameLength()
00449    */
00450   public int getMaxColumnNameLength() throws SQLException
00451   {
00452     return ((Integer) getMetadata(
00453         MetadataDescription.GET_MAX_COLUMN_NAME_LENGTH, null, null, false))
00454         .intValue();
00455   }
00456 
00457   /**
00458    * @see java.sql.DatabaseMetaData#getMaxColumnsInGroupBy()
00459    */
00460   public int getMaxColumnsInGroupBy() throws SQLException
00461   {
00462     return ((Integer) getMetadata(
00463         MetadataDescription.GET_MAX_COLUMNS_IN_GROUP_BY, null, null, false))
00464         .intValue();
00465   }
00466 
00467   /**
00468    * @see java.sql.DatabaseMetaData#getMaxColumnsInIndex()
00469    */
00470   public int getMaxColumnsInIndex() throws SQLException
00471   {
00472     return ((Integer) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_INDEX,
00473         null, null, false)).intValue();
00474   }
00475 
00476   /**
00477    * @see java.sql.DatabaseMetaData#getMaxColumnsInOrderBy()
00478    */
00479   public int getMaxColumnsInOrderBy() throws SQLException
00480   {
00481     return ((Integer) getMetadata(
00482         MetadataDescription.GET_MAX_COLUMNS_IN_ORDER_BY, null, null, false))
00483         .intValue();
00484   }
00485 
00486   /**
00487    * @see java.sql.DatabaseMetaData#getMaxColumnsInSelect()
00488    */
00489   public int getMaxColumnsInSelect() throws SQLException
00490   {
00491     return ((Integer) getMetadata(
00492         MetadataDescription.GET_MAX_COLUMNS_IN_SELECT, null, null, false))
00493         .intValue();
00494   }
00495 
00496   /**
00497    * @see java.sql.DatabaseMetaData#getMaxColumnsInTable()
00498    */
00499   public int getMaxColumnsInTable() throws SQLException
00500   {
00501     return ((Integer) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_TABLE,
00502         null, null, false)).intValue();
00503   }
00504 
00505   /**
00506    * Maximum number of connections to the database (virtually no limit since
00507    * these are virtual connections to the Controller). The spec says 0 should be
00508    * returned if unknown.
00509    * 
00510    * @return value retrieved from first enabled backend
00511    * @exception SQLException if a database access error occurs
00512    */
00513   public int getMaxConnections() throws SQLException
00514   {
00515     //TODO: max connection should be the max number of connection to the
00516     // virtual database
00517     return ((Integer) getMetadata(MetadataDescription.GET_MAX_CONNECTIONS,
00518         null, null, false)).intValue();
00519   }
00520 
00521   /**
00522    * @see java.sql.DatabaseMetaData#getMaxCursorNameLength()
00523    */
00524   public int getMaxCursorNameLength() throws SQLException
00525   {
00526     return ((Integer) getMetadata(
00527         MetadataDescription.GET_MAX_CURSOR_NAME_LENGTH, null, null, false))
00528         .intValue();
00529   }
00530 
00531   /**
00532    * @see java.sql.DatabaseMetaData#getMaxIndexLength()
00533    */
00534   public int getMaxIndexLength() throws SQLException
00535   {
00536     return ((Integer) getMetadata(MetadataDescription.GET_MAX_INDEX_LENGTH,
00537         null, null, false)).intValue();
00538   }
00539 
00540   /**
00541    * @see java.sql.DatabaseMetaData#getMaxProcedureNameLength()
00542    */
00543   public int getMaxProcedureNameLength() throws SQLException
00544   {
00545     return ((Integer) getMetadata(
00546         MetadataDescription.GET_MAX_PROCEDURE_NAME_LENGTH, null, null, false))
00547         .intValue();
00548   }
00549 
00550   /**
00551    * @see java.sql.DatabaseMetaData#getMaxRowSize()
00552    */
00553   public int getMaxRowSize() throws SQLException
00554   {
00555     return ((Integer) getMetadata(MetadataDescription.GET_MAX_ROW_SIZE, null,
00556         null, false)).intValue();
00557   }
00558 
00559   /**
00560    * @see java.sql.DatabaseMetaData#getMaxSchemaNameLength()
00561    */
00562   public int getMaxSchemaNameLength() throws SQLException
00563   {
00564     return ((Integer) getMetadata(
00565         MetadataDescription.GET_MAX_SCHEMA_NAME_LENGTH, null, null, false))
00566         .intValue();
00567   }
00568 
00569   /**
00570    * @see java.sql.DatabaseMetaData#getMaxStatementLength()
00571    */
00572   public int getMaxStatementLength() throws SQLException
00573   {
00574     return ((Integer) getMetadata(MetadataDescription.GET_MAX_STATEMENT_LENGTH,
00575         null, null, false)).intValue();
00576   }
00577 
00578   /**
00579    * @see java.sql.DatabaseMetaData#getMaxStatements()
00580    */
00581   public int getMaxStatements() throws SQLException
00582   {
00583     return ((Integer) getMetadata(MetadataDescription.GET_MAX_STATEMENTS, null,
00584         null, false)).intValue();
00585   }
00586 
00587   /**
00588    * @see java.sql.DatabaseMetaData#getMaxTableNameLength()
00589    */
00590   public int getMaxTableNameLength() throws SQLException
00591   {
00592     return ((Integer) getMetadata(
00593         MetadataDescription.GET_MAX_TABLE_NAME_LENGTH, null, null, false))
00594         .intValue();
00595   }
00596 
00597   /**
00598    * @see java.sql.DatabaseMetaData#getMaxTablesInSelect()
00599    */
00600   public int getMaxTablesInSelect() throws SQLException
00601   {
00602     return ((Integer) getMetadata(MetadataDescription.GET_MAX_TABLES_IN_SELECT,
00603         null, null, false)).intValue();
00604   }
00605 
00606   /**
00607    * @see java.sql.DatabaseMetaData#getMaxUserNameLength()
00608    */
00609   public int getMaxUserNameLength() throws SQLException
00610   {
00611     return ((Integer) getMetadata(MetadataDescription.GET_MAX_USER_NAME_LENGTH,
00612         null, null, false)).intValue();
00613   }
00614 
00615   /**
00616    * @see java.sql.DatabaseMetaData#getNumericFunctions()
00617    */
00618   public String getNumericFunctions() throws SQLException
00619   {
00620     return ((String) getMetadata(MetadataDescription.GET_NUMERIC_FUNCTIONS,
00621         null, null, true));
00622   }
00623 
00624   /**
00625    * @see java.sql.DatabaseMetaData#getPrimaryKeys(java.lang.String,
00626    *      java.lang.String, java.lang.String)
00627    */
00628   public java.sql.ResultSet getPrimaryKeys(String catalog, String schema,
00629       String table) throws SQLException
00630   {
00631     return connection.getPrimaryKeys(catalog, schema, table);
00632   }
00633 
00634   /**
00635    * @see java.sql.DatabaseMetaData#getProcedureColumns(java.lang.String,
00636    *      java.lang.String, java.lang.String, java.lang.String)
00637    */
00638   public java.sql.ResultSet getProcedureColumns(String catalog,
00639       String schemaPattern, String procedureNamePattern,
00640       String columnNamePattern) throws SQLException
00641   {
00642     return connection.getProcedureColumns(catalog, schemaPattern,
00643         procedureNamePattern, columnNamePattern);
00644   }
00645 
00646   /**
00647    * @see java.sql.DatabaseMetaData#getProcedures(java.lang.String,
00648    *      java.lang.String, java.lang.String)
00649    */
00650   public java.sql.ResultSet getProcedures(String catalog, String schemaPattern,
00651       String procedureNamePattern) throws SQLException
00652   {
00653     return connection.getProcedures(catalog, schemaPattern,
00654         procedureNamePattern);
00655   }
00656 
00657   /**
00658    * @see java.sql.DatabaseMetaData#getProcedureTerm()
00659    */
00660   public String getProcedureTerm() throws SQLException
00661   {
00662     return ((String) getMetadata(MetadataDescription.GET_PROCEDURE_TERM, null,
00663         null, true));
00664   }
00665 
00666   /**
00667    * @see java.sql.DatabaseMetaData#getSchemas()
00668    */
00669   public java.sql.ResultSet getSchemas() throws SQLException
00670   {
00671     return connection.getSchemas();
00672   }
00673 
00674   /**
00675    * @see java.sql.DatabaseMetaData#getSchemaTerm()
00676    */
00677   public String getSchemaTerm() throws SQLException
00678   {
00679     return ((String) getMetadata(MetadataDescription.GET_SCHEMA_TERM, null,
00680         null, true));
00681   }
00682 
00683   /**
00684    * @see java.sql.DatabaseMetaData#getSearchStringEscape()
00685    */
00686   public String getSearchStringEscape() throws SQLException
00687   {
00688     return ((String) getMetadata(MetadataDescription.GET_SEARCH_STRING_ESCAPE,
00689         null, null, true));
00690   }
00691 
00692   /**
00693    * @see java.sql.DatabaseMetaData#getSQLKeywords()
00694    */
00695   public String getSQLKeywords() throws SQLException
00696   {
00697     return ((String) getMetadata(MetadataDescription.GET_SQL_KEYWORDS, null,
00698         null, true));
00699   }
00700 
00701   /**
00702    * @see java.sql.DatabaseMetaData#getStringFunctions()
00703    */
00704   public String getStringFunctions() throws SQLException
00705   {
00706     return ((String) getMetadata(MetadataDescription.GET_STRING_FUNCTIONS,
00707         null, null, true));
00708   }
00709 
00710   /**
00711    * @see java.sql.DatabaseMetaData#getSystemFunctions()
00712    */
00713   public String getSystemFunctions() throws SQLException
00714   {
00715     return ((String) getMetadata(MetadataDescription.GET_SYSTEM_FUNCTIONS,
00716         null, null, true));
00717   }
00718 
00719   /**
00720    * Gets a description of the available tables.
00721    * 
00722    * @param catalog a catalog name; this is ignored, and should be set to
00723    *          <code>null</code>
00724    * @param schemaPattern a schema name pattern; this is ignored, and should be
00725    *          set to <code>null</code>
00726    * @param tableNamePattern a table name pattern. For all tables this should be
00727    *          "%"
00728    * @param types a list of table types to include; <code>null</code> returns
00729    *          all types
00730    * @return <code>null</code>
00731    * @exception SQLException if a database-access error occurs.
00732    */
00733   public java.sql.ResultSet getTables(String catalog, String schemaPattern,
00734       String tableNamePattern, String types[]) throws SQLException
00735   {
00736     return connection
00737         .getTables(catalog, schemaPattern, tableNamePattern, types);
00738   }
00739 
00740   /**
00741    * Gets a description of the access rights for each table available in a
00742    * catalog. Note that a table privilege applies to one or more columns in the
00743    * table. It would be wrong to assume that this priviledge applies to all
00744    * columns (this may be true for some systems but is not true for all.) Only
00745    * privileges matching the schema and table name criteria are returned. They
00746    * are ordered by TABLE_SCHEM, TABLE_NAME, and PRIVILEGE.
00747    * 
00748    * @param catalog a catalog name; "" retrieves those without a catalog; null
00749    *          means drop catalog name from the selection criteria
00750    * @param schemaPattern a schema name pattern; "" retrieves those without a
00751    *          schema
00752    * @param tableNamePattern a table name pattern
00753    * @return <code>ResultSet</code> each row is a table privilege description
00754    * @throws SQLException if a database access error occurs
00755    */
00756   public java.sql.ResultSet getTablePrivileges(String catalog,
00757       String schemaPattern, String tableNamePattern) throws SQLException
00758   {
00759     return connection.getTablePrivileges(catalog, schemaPattern,
00760         tableNamePattern);
00761   }
00762 
00763   /**
00764    * Gets the table types available in this database. The results are ordered by
00765    * table type.
00766    * 
00767    * @return <code>ResultSet</code> each row has a single String column that
00768    *         is a catalog name
00769    * @throws SQLException if a database error occurs
00770    */
00771   public java.sql.ResultSet getTableTypes() throws SQLException
00772   {
00773     return connection.getTableTypes();
00774   }
00775 
00776   /**
00777    * @see java.sql.DatabaseMetaData#getTimeDateFunctions()
00778    */
00779   public String getTimeDateFunctions() throws SQLException
00780   {
00781     return ((String) getMetadata(MetadataDescription.GET_TIME_DATE_FUNCTIONS,
00782         null, null, true));
00783   }
00784 
00785   /**
00786    * Feature not yet supported by C-JDBC.
00787    * 
00788    * @return <code>null</code>
00789    * @exception SQLException if a database access error occurs
00790    */
00791   public java.sql.ResultSet getTypeInfo() throws SQLException
00792   {
00793     return null;
00794   }
00795 
00796   /**
00797    * Feature not yet supported by C-JDBC.
00798    * 
00799    * @param catalog a <code>String</code> value
00800    * @param schemaPattern a <code>String</code> value
00801    * @param typeNamePattern a <code>String</code> value
00802    * @param types an <code>int[]</code> value
00803    * @return <code>null</code>
00804    * @exception SQLException if an error occurs
00805    */
00806   public java.sql.ResultSet getUDTs(String catalog, String schemaPattern,
00807       String typeNamePattern, int[] types) throws SQLException
00808   {
00809     return null;
00810   }
00811 
00812   /**
00813    * What is the URL for this database?
00814    * 
00815    * @return the url or null if it cannott be generated
00816    * @exception SQLException if a database access error occurs
00817    */
00818   public String getURL() throws SQLException
00819   {
00820     return connection.getURL();
00821   }
00822 
00823   /**
00824    * What is our user name as known to the database?
00825    * 
00826    * @return our database user name
00827    * @exception SQLException if a database access error occurs
00828    */
00829   public String getUserName() throws SQLException
00830   {
00831     return connection.getUserName();
00832   }
00833 
00834   /**
00835    * Feature not yet supported by C-JDBC.
00836    * 
00837    * @param catalog a catalog name; "" retrieves those without a catalog
00838    * @param schema a schema name; "" retrieves those without a schema
00839    * @param table a table name
00840    * @return <code>null</code>
00841    * @exception SQLException if a database access error occurs
00842    */
00843   public java.sql.ResultSet getVersionColumns(String catalog, String schema,
00844       String table) throws SQLException
00845   {
00846     return null;
00847   }
00848 
00849   /**
00850    * @see java.sql.DatabaseMetaData#insertsAreDetected(int)
00851    */
00852   public boolean insertsAreDetected(int type) throws SQLException
00853   {
00854     return ((Boolean) getMetadata(MetadataDescription.INSERTS_ARE_DETECTED,
00855         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00856         .booleanValue();
00857   }
00858 
00859   /**
00860    * @see java.sql.DatabaseMetaData#isCatalogAtStart()
00861    */
00862   public boolean isCatalogAtStart() throws SQLException
00863   {
00864     return ((Boolean) getMetadata(MetadataDescription.IS_CATALOG_AT_START,
00865         null, null, false)).booleanValue();
00866   }
00867 
00868   /**
00869    * Is the database in read-only mode?
00870    * 
00871    * @return <code>true</code> if so
00872    * @exception SQLException if a database access error occurs
00873    */
00874   public boolean isReadOnly() throws SQLException
00875   {
00876     return connection.isReadOnly();
00877   }
00878 
00879   /**
00880    * @see java.sql.DatabaseMetaData#nullPlusNonNullIsNull()
00881    */
00882   public boolean nullPlusNonNullIsNull() throws SQLException
00883   {
00884     return ((Boolean) getMetadata(
00885         MetadataDescription.NULL_PLUS_NON_NULL_IS_NULL, null, null, false))
00886         .booleanValue();
00887   }
00888 
00889   /**
00890    * @see java.sql.DatabaseMetaData#nullsAreSortedAtEnd()
00891    */
00892   public boolean nullsAreSortedAtEnd() throws SQLException
00893   {
00894     return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_AT_END,
00895         null, null, false)).booleanValue();
00896   }
00897 
00898   /**
00899    * @see java.sql.DatabaseMetaData#nullsAreSortedAtStart()
00900    */
00901   public boolean nullsAreSortedAtStart() throws SQLException
00902   {
00903     return ((Boolean) getMetadata(
00904         MetadataDescription.NULLS_ARE_SORTED_AT_START, null, null, false))
00905         .booleanValue();
00906   }
00907 
00908   /**
00909    * @see java.sql.DatabaseMetaData#nullsAreSortedHigh()
00910    */
00911   public boolean nullsAreSortedHigh() throws SQLException
00912   {
00913     return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_HIGH,
00914         null, null, false)).booleanValue();
00915   }
00916 
00917   /**
00918    * @see java.sql.DatabaseMetaData#nullsAreSortedLow()
00919    */
00920   public boolean nullsAreSortedLow() throws SQLException
00921   {
00922     return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_LOW,
00923         null, null, false)).booleanValue();
00924   }
00925 
00926   /**
00927    * @see java.sql.DatabaseMetaData#othersDeletesAreVisible(int)
00928    */
00929   public boolean othersDeletesAreVisible(int type) throws SQLException
00930   {
00931     return ((Boolean) getMetadata(
00932         MetadataDescription.OTHERS_DELETES_ARE_VISIBLE,
00933         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00934         .booleanValue();
00935   }
00936 
00937   /**
00938    * @see java.sql.DatabaseMetaData#othersInsertsAreVisible(int)
00939    */
00940   public boolean othersInsertsAreVisible(int type) throws SQLException
00941   {
00942     return ((Boolean) getMetadata(
00943         MetadataDescription.OTHERS_INSERTS_ARE_VISIBLE,
00944         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00945         .booleanValue();
00946   }
00947 
00948   /**
00949    * @see java.sql.DatabaseMetaData#othersUpdatesAreVisible(int)
00950    */
00951   public boolean othersUpdatesAreVisible(int type) throws SQLException
00952   {
00953     return ((Boolean) getMetadata(
00954         MetadataDescription.OTHERS_UPDATES_ARE_VISIBLE,
00955         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00956         .booleanValue();
00957   }
00958 
00959   /**
00960    * @see java.sql.DatabaseMetaData#ownDeletesAreVisible(int)
00961    */
00962   public boolean ownDeletesAreVisible(int type) throws SQLException
00963   {
00964     return ((Boolean) getMetadata(MetadataDescription.OWN_DELETES_ARE_VISIBLE,
00965         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00966         .booleanValue();
00967   }
00968 
00969   /**
00970    * @see java.sql.DatabaseMetaData#ownInsertsAreVisible(int)
00971    */
00972   public boolean ownInsertsAreVisible(int type) throws SQLException
00973   {
00974     return ((Boolean) getMetadata(MetadataDescription.OWN_INSERTS_ARE_VISIBLE,
00975         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00976         .booleanValue();
00977 
00978   }
00979 
00980   /**
00981    * @see java.sql.DatabaseMetaData#ownUpdatesAreVisible(int)
00982    */
00983   public boolean ownUpdatesAreVisible(int type) throws SQLException
00984   {
00985     return ((Boolean) getMetadata(MetadataDescription.OWN_UPDATES_ARE_VISIBLE,
00986         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00987         .booleanValue();
00988   }
00989 
00990   /**
00991    * @see java.sql.DatabaseMetaData#storesLowerCaseIdentifiers()
00992    */
00993   public boolean storesLowerCaseIdentifiers() throws SQLException
00994   {
00995     return ((Boolean) getMetadata(
00996         MetadataDescription.STORES_LOWER_CASE_IDENTIFIERS, null, null, false))
00997         .booleanValue();
00998   }
00999 
01000   /**
01001    * @see java.sql.DatabaseMetaData#storesLowerCaseQuotedIdentifiers()
01002    */
01003   public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
01004   {
01005     return ((Boolean) getMetadata(
01006         MetadataDescription.STORES_LOWER_CASE_QUOTED_IDENTIFIERS, null, null,
01007         false)).booleanValue();
01008   }
01009 
01010   /**
01011    * @see java.sql.DatabaseMetaData#storesMixedCaseIdentifiers()
01012    */
01013   public boolean storesMixedCaseIdentifiers() throws SQLException
01014   {
01015     return ((Boolean) getMetadata(
01016         MetadataDescription.STORES_MIXED_CASE_IDENTIFIERS, null, null, false))
01017         .booleanValue();
01018   }
01019 
01020   /**
01021    * @see java.sql.DatabaseMetaData#storesMixedCaseQuotedIdentifiers()
01022    */
01023   public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
01024   {
01025     return ((Boolean) getMetadata(
01026         MetadataDescription.STORES_MIXED_CASE_QUOTED_IDENTIFIERS, null, null,
01027         false)).booleanValue();
01028   }
01029 
01030   /**
01031    * @see java.sql.DatabaseMetaData#storesUpperCaseIdentifiers()
01032    */
01033   public boolean storesUpperCaseIdentifiers() throws SQLException
01034   {
01035     return ((Boolean) getMetadata(
01036         MetadataDescription.STORES_UPPER_CASE_IDENTIFIERS, null, null, false))
01037         .booleanValue();
01038   }
01039 
01040   /**
01041    * @see java.sql.DatabaseMetaData#storesUpperCaseQuotedIdentifiers()
01042    */
01043   public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
01044   {
01045     return ((Boolean) getMetadata(
01046         MetadataDescription.STORES_UPPER_CASE_QUOTED_IDENTIFIERS, null, null,
01047         false)).booleanValue();
01048   }
01049 
01050   /**
01051    * @see java.sql.DatabaseMetaData#supportsAlterTableWithAddColumn()
01052    */
01053   public boolean supportsAlterTableWithAddColumn() throws SQLException
01054   {
01055     return ((Boolean) getMetadata(
01056         MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_ADD_COLUMN, null, null,
01057         false)).booleanValue();
01058   }
01059 
01060   /**
01061    * @see java.sql.DatabaseMetaData#supportsAlterTableWithDropColumn()
01062    */
01063   public boolean supportsAlterTableWithDropColumn() throws SQLException
01064   {
01065     return ((Boolean) getMetadata(
01066         MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_DROP_COLUMN, null, null,
01067         false)).booleanValue();
01068   }
01069 
01070   /**
01071    * @see java.sql.DatabaseMetaData#supportsANSI92EntryLevelSQL()
01072    */
01073   public boolean supportsANSI92EntryLevelSQL() throws SQLException
01074   {
01075     return ((Boolean) getMetadata(
01076         MetadataDescription.SUPPORTS_ANSI92_ENTRY_LEVEL_SQL, null, null, false))
01077         .booleanValue();
01078   }
01079 
01080   /**
01081    * @see java.sql.DatabaseMetaData#supportsANSI92FullSQL()
01082    */
01083   public boolean supportsANSI92FullSQL() throws SQLException
01084   {
01085     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_ANSI92_FULL_SQL,
01086         null, null, false)).booleanValue();
01087   }
01088 
01089   /**
01090    * @see java.sql.DatabaseMetaData#supportsANSI92IntermediateSQL()
01091    */
01092   public boolean supportsANSI92IntermediateSQL() throws SQLException
01093   {
01094     return ((Boolean) getMetadata(
01095         MetadataDescription.SUPPORTS_ANSI92_INTERMEDIATE_SQL, null, null, false))
01096         .booleanValue();
01097   }
01098 
01099   /**
01100    * @see java.sql.DatabaseMetaData#supportsBatchUpdates()
01101    */
01102   public boolean supportsBatchUpdates() throws SQLException
01103   {
01104     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_BATCH_UPDATES,
01105         null, null, false)).booleanValue();
01106   }
01107 
01108   /**
01109    * @see java.sql.DatabaseMetaData#supportsCatalogsInDataManipulation()
01110    */
01111   public boolean supportsCatalogsInDataManipulation() throws SQLException
01112   {
01113     return ((Boolean) getMetadata(
01114         MetadataDescription.SUPPORTS_CATALOGS_IN_DATA_MANIPULATION, null, null,
01115         false)).booleanValue();
01116   }
01117 
01118   /**
01119    * @see java.sql.DatabaseMetaData#supportsCatalogsInIndexDefinitions()
01120    */
01121   public boolean supportsCatalogsInIndexDefinitions() throws SQLException
01122   {
01123     return ((Boolean) getMetadata(
01124         MetadataDescription.SUPPORTS_CATALOGS_IN_INDEX_DEFINITIONS, null, null,
01125         false)).booleanValue();
01126   }
01127 
01128   /**
01129    * @see java.sql.DatabaseMetaData#supportsCatalogsInPrivilegeDefinitions()
01130    */
01131   public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
01132   {
01133     return ((Boolean) getMetadata(
01134         MetadataDescription.SUPPORTS_CATALOGS_IN_PRIVILEGE_DEFINITIONS, null,
01135         null, false)).booleanValue();
01136   }
01137 
01138   /**
01139    * @see java.sql.DatabaseMetaData#supportsCatalogsInProcedureCalls()
01140    */
01141   public boolean supportsCatalogsInProcedureCalls() throws SQLException
01142   {
01143     return ((Boolean) getMetadata(
01144         MetadataDescription.SUPPORTS_CATALOGS_IN_PROCEDURE_CALLS, null, null,
01145         false)).booleanValue();
01146   }
01147 
01148   /**
01149    * @see java.sql.DatabaseMetaData#supportsCatalogsInTableDefinitions()
01150    */
01151   public boolean supportsCatalogsInTableDefinitions() throws SQLException
01152   {
01153     return ((Boolean) getMetadata(
01154         MetadataDescription.SUPPORTS_CATALOGS_IN_TABLE_DEFINITIONS, null, null,
01155         false)).booleanValue();
01156   }
01157 
01158   /**
01159    * @see java.sql.DatabaseMetaData#supportsColumnAliasing()
01160    */
01161   public boolean supportsColumnAliasing() throws SQLException
01162   {
01163     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_COLUMN_ALIASING,
01164         null, null, false)).booleanValue();
01165   }
01166 
01167   /**
01168    * @see java.sql.DatabaseMetaData#supportsConvert()
01169    */
01170   public boolean supportsConvert() throws SQLException
01171   {
01172     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_CONVERT, null,
01173         null, false)).booleanValue();
01174   }
01175 
01176   /**
01177    * Not implemented (returns <code>false</code>). We should ask the
01178    * Controller to know.
01179    * 
01180    * @param fromType an <code>int</code> value
01181    * @param toType an <code>int</code> value
01182    * @return <code>false</code>
01183    * @exception SQLException <description>
01184    */
01185   public boolean supportsConvert(int fromType, int toType) throws SQLException
01186   {
01187     return false;
01188   }
01189 
01190   /**
01191    * @see java.sql.DatabaseMetaData#supportsCoreSQLGrammar()
01192    */
01193   public boolean supportsCoreSQLGrammar() throws SQLException
01194   {
01195     return ((Boolean) getMetadata(
01196         MetadataDescription.SUPPORTS_CORE_SQL_GRAMMAR, null, null, false))
01197         .booleanValue();
01198   }
01199 
01200   /**
01201    * @see java.sql.DatabaseMetaData#supportsCorrelatedSubqueries()
01202    */
01203   public boolean supportsCorrelatedSubqueries() throws SQLException
01204   {
01205     return ((Boolean) getMetadata(
01206         MetadataDescription.SUPPORTS_CORRELATED_SUBQUERIES, null, null, false))
01207         .booleanValue();
01208   }
01209 
01210   /**
01211    * @see java.sql.DatabaseMetaData#supportsDataDefinitionAndDataManipulationTransactions()
01212    */
01213   public boolean supportsDataDefinitionAndDataManipulationTransactions()
01214       throws SQLException
01215   {
01216     return ((Boolean) getMetadata(
01217         MetadataDescription.SUPPORTS_DATA_DEFINITION_AND_DATA_MANIPULATION_TRANSACTIONS,
01218         null, null, false)).booleanValue();
01219   }
01220 
01221   /**
01222    * @see java.sql.DatabaseMetaData#supportsDataManipulationTransactionsOnly()
01223    */
01224   public boolean supportsDataManipulationTransactionsOnly() throws SQLException
01225   {
01226     return ((Boolean) getMetadata(
01227         MetadataDescription.SUPPORTS_DATA_MANIPULATION_TRANSACTIONS_ONLY, null,
01228         null, false)).booleanValue();
01229   }
01230 
01231   /**
01232    * @see java.sql.DatabaseMetaData#supportsDifferentTableCorrelationNames()
01233    */
01234   public boolean supportsDifferentTableCorrelationNames() throws SQLException
01235   {
01236     return ((Boolean) getMetadata(
01237         MetadataDescription.SUPPORTS_DIFFERENT_TABLE_CORRELATION_NAMES, null,
01238         null, false)).booleanValue();
01239   }
01240 
01241   /**
01242    * @see java.sql.DatabaseMetaData#supportsExpressionsInOrderBy()
01243    */
01244   public boolean supportsExpressionsInOrderBy() throws SQLException
01245   {
01246     return ((Boolean) getMetadata(
01247         MetadataDescription.SUPPORTS_EXPRESSIONS_IN_ORDER_BY, null, null, false))
01248         .booleanValue();
01249   }
01250 
01251   /**
01252    * @see java.sql.DatabaseMetaData#supportsExtendedSQLGrammar()
01253    */
01254   public boolean supportsExtendedSQLGrammar() throws SQLException
01255   {
01256     return ((Boolean) getMetadata(
01257         MetadataDescription.SUPPORTS_EXTENDED_SQL_GRAMMAR, null, null, false))
01258         .booleanValue();
01259   }
01260 
01261   /**
01262    * @see java.sql.DatabaseMetaData#supportsFullOuterJoins()
01263    */
01264   public boolean supportsFullOuterJoins() throws SQLException
01265   {
01266     return ((Boolean) getMetadata(
01267         MetadataDescription.SUPPORTS_FULL_OUTER_JOINS, null, null, false))
01268         .booleanValue();
01269   }
01270 
01271   /**
01272    * @see java.sql.DatabaseMetaData#supportsGroupBy()
01273    */
01274   public boolean supportsGroupBy() throws SQLException
01275   {
01276     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_GROUP_BY, null,
01277         null, false)).booleanValue();
01278   }
01279 
01280   /**
01281    * @see java.sql.DatabaseMetaData#supportsGroupByBeyondSelect()
01282    */
01283   public boolean supportsGroupByBeyondSelect() throws SQLException
01284   {
01285     return ((Boolean) getMetadata(
01286         MetadataDescription.SUPPORTS_GROUP_BY_BEYOND_SELECT, null, null, false))
01287         .booleanValue();
01288   }
01289 
01290   /**
01291    * @see java.sql.DatabaseMetaData#supportsGroupByUnrelated()
01292    */
01293   public boolean supportsGroupByUnrelated() throws SQLException
01294   {
01295     return ((Boolean) getMetadata(
01296         MetadataDescription.SUPPORTS_GROUP_BY_UNRELATED, null, null, false))
01297         .booleanValue();
01298   }
01299 
01300   /**
01301    * @see java.sql.DatabaseMetaData#supportsIntegrityEnhancementFacility()
01302    */
01303   public boolean supportsIntegrityEnhancementFacility() throws SQLException
01304   {
01305     return ((Boolean) getMetadata(
01306         MetadataDescription.SUPPORTS_INTEGRITY_ENHANCEMENT_FACILITY, null,
01307         null, false)).booleanValue();
01308   }
01309 
01310   /**
01311    * @see java.sql.DatabaseMetaData#supportsLikeEscapeClause()
01312    */
01313   public boolean supportsLikeEscapeClause() throws SQLException
01314   {
01315     return ((Boolean) getMetadata(
01316         MetadataDescription.SUPPORTS_LIKE_ESCAPE_CLAUSE, null, null, false))
01317         .booleanValue();
01318   }
01319 
01320   /**
01321    * @see java.sql.DatabaseMetaData#supportsLimitedOuterJoins()
01322    */
01323   public boolean supportsLimitedOuterJoins() throws SQLException
01324   {
01325     return ((Boolean) getMetadata(
01326         MetadataDescription.SUPPORTS_LIMITED_OUTER_JOINS, null, null, false))
01327         .booleanValue();
01328   }
01329 
01330   /**
01331    * @see java.sql.DatabaseMetaData#supportsMinimumSQLGrammar()
01332    */
01333   public boolean supportsMinimumSQLGrammar() throws SQLException
01334   {
01335     return ((Boolean) getMetadata(
01336         MetadataDescription.SUPPORTS_MINIMUM_SQL_GRAMMAR, null, null, false))
01337         .booleanValue();
01338   }
01339 
01340   /**
01341    * @see java.sql.DatabaseMetaData#supportsMixedCaseIdentifiers()
01342    */
01343   public boolean supportsMixedCaseIdentifiers() throws SQLException
01344   {
01345     return ((Boolean) getMetadata(
01346         MetadataDescription.SUPPORTS_MIXED_CASE_IDENTIFIERS, null, null, false))
01347         .booleanValue();
01348   }
01349 
01350   /**
01351    * @see java.sql.DatabaseMetaData#supportsMixedCaseQuotedIdentifiers()
01352    */
01353   public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
01354   {
01355     return ((Boolean) getMetadata(
01356         MetadataDescription.SUPPORTS_MIXED_CASE_QUOTED_IDENTIFIERS, null, null,
01357         false)).booleanValue();
01358   }
01359 
01360   /**
01361    * @see java.sql.DatabaseMetaData#supportsMultipleResultSets()
01362    */
01363   public boolean supportsMultipleResultSets() throws SQLException
01364   {
01365     return ((Boolean) getMetadata(
01366         MetadataDescription.SUPPORTS_MULTIPLE_RESULTSETS, null, null, false))
01367         .booleanValue();
01368   }
01369 
01370   /**
01371    * @see java.sql.DatabaseMetaData#supportsMultipleTransactions()
01372    */
01373   public boolean supportsMultipleTransactions() throws SQLException
01374   {
01375     return ((Boolean) getMetadata(
01376         MetadataDescription.SUPPORTS_MULTIPLE_TRANSACTIONS, null, null, false))
01377         .booleanValue();
01378   }
01379 
01380   /**
01381    * @see java.sql.DatabaseMetaData#supportsNonNullableColumns()
01382    */
01383   public boolean supportsNonNullableColumns() throws SQLException
01384   {
01385     return ((Boolean) getMetadata(
01386         MetadataDescription.SUPPORTS_NON_NULLABLE_COLUMNS, null, null, false))
01387         .booleanValue();
01388   }
01389 
01390   /**
01391    * @see java.sql.DatabaseMetaData#supportsOpenCursorsAcrossCommit()
01392    */
01393   public boolean supportsOpenCursorsAcrossCommit() throws SQLException
01394   {
01395     return ((Boolean) getMetadata(
01396         MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_COMMIT, null, null,
01397         false)).booleanValue();
01398   }
01399 
01400   /**
01401    * @see java.sql.DatabaseMetaData#supportsOpenCursorsAcrossRollback()
01402    */
01403   public boolean supportsOpenCursorsAcrossRollback() throws SQLException
01404   {
01405     return ((Boolean) getMetadata(
01406         MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_ROLLBACK, null, null,
01407         false)).booleanValue();
01408   }
01409 
01410   /**
01411    * @see java.sql.DatabaseMetaData#supportsOpenStatementsAcrossCommit()
01412    */
01413   public boolean supportsOpenStatementsAcrossCommit() throws SQLException
01414   {
01415     return ((Boolean) getMetadata(
01416         MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_COMMIT, null, null,
01417         false)).booleanValue();
01418   }
01419 
01420   /**
01421    * @see java.sql.DatabaseMetaData#supportsOpenStatementsAcrossRollback()
01422    */
01423   public boolean supportsOpenStatementsAcrossRollback() throws SQLException
01424   {
01425     return ((Boolean) getMetadata(
01426         MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_ROLLBACK, null,
01427         null, false)).booleanValue();
01428   }
01429 
01430   /**
01431    * @see java.sql.DatabaseMetaData#supportsOrderByUnrelated()
01432    */
01433   public boolean supportsOrderByUnrelated() throws SQLException
01434   {
01435     return ((Boolean) getMetadata(
01436         MetadataDescription.SUPPORTS_ORDER_BY_UNRELATED, null, null, false))
01437         .booleanValue();
01438   }
01439 
01440   /**
01441    * @see java.sql.DatabaseMetaData#supportsOuterJoins()
01442    */
01443   public boolean supportsOuterJoins() throws SQLException
01444   {
01445     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_OUTER_JOINS,
01446         null, null, false)).booleanValue();
01447   }
01448 
01449   /**
01450    * @see java.sql.DatabaseMetaData#supportsPositionedDelete()
01451    */
01452   public boolean supportsPositionedDelete() throws SQLException
01453   {
01454     return ((Boolean) getMetadata(
01455         MetadataDescription.SUPPORTS_POSITIONED_DELETE, null, null, false))
01456         .booleanValue();
01457   }
01458 
01459   /**
01460    * @see java.sql.DatabaseMetaData#supportsPositionedUpdate()
01461    */
01462   public boolean supportsPositionedUpdate() throws SQLException
01463   {
01464     return ((Boolean) getMetadata(
01465         MetadataDescription.SUPPORTS_POSITIONED_UPDATE, null, null, false))
01466         .booleanValue();
01467   }
01468 
01469   /**
01470    * @see java.sql.DatabaseMetaData#supportsResultSetConcurrency(int, int)
01471    */
01472   public boolean supportsResultSetConcurrency(int type, int concurrency)
01473       throws SQLException
01474   {
01475     return ((Boolean) getMetadata(
01476         MetadataDescription.SUPPORTS_RESULT_SET_CONCURRENCY,
01477         new Class[]{Integer.TYPE, Integer.TYPE},
01478         new Object[]{new Integer(type), new Integer(concurrency)},
01479         false)).booleanValue();
01480   }
01481 
01482   /**
01483    * @see java.sql.DatabaseMetaData#supportsResultSetHoldability(int)
01484    */
01485   public boolean supportsResultSetHoldability(int holdability)
01486       throws SQLException
01487   {
01488     return ((Boolean) getMetadata(
01489         MetadataDescription.SUPPORTS_RESULT_SET_HOLDABILITY,
01490         new Class[]{Integer.TYPE}, new Object[]{new Integer(holdability)},
01491         false)).booleanValue();
01492   }
01493 
01494   /**
01495    * @see java.sql.DatabaseMetaData#supportsResultSetType(int)
01496    */
01497   public boolean supportsResultSetType(int type) throws SQLException
01498   {
01499     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_RESULT_SET_TYPE,
01500         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
01501         .booleanValue();
01502   }
01503 
01504   /**
01505    * @see java.sql.DatabaseMetaData#supportsSchemasInDataManipulation()
01506    */
01507   public boolean supportsSchemasInDataManipulation() throws SQLException
01508   {
01509     return ((Boolean) getMetadata(
01510         MetadataDescription.SUPPORTS_SCHEMAS_IN_DATA_MANIPULATION, null, null,
01511         false)).booleanValue();
01512   }
01513 
01514   /**
01515    * @see java.sql.DatabaseMetaData#supportsSchemasInIndexDefinitions()
01516    */
01517   public boolean supportsSchemasInIndexDefinitions() throws SQLException
01518   {
01519     return ((Boolean) getMetadata(
01520         MetadataDescription.SUPPORTS_SCHEMAS_IN_INDEX_DEFINITIONS, null, null,
01521         false)).booleanValue();
01522   }
01523 
01524   /**
01525    * @see java.sql.DatabaseMetaData#supportsSchemasInPrivilegeDefinitions()
01526    */
01527   public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
01528   {
01529     return ((Boolean) getMetadata(
01530         MetadataDescription.SUPPORTS_SCHEMAS_IN_PRIVILEGE_DEFINITIONS, null,
01531         null, false)).booleanValue();
01532   }
01533 
01534   /**
01535    * @see java.sql.DatabaseMetaData#supportsSchemasInProcedureCalls()
01536    */
01537   public boolean supportsSchemasInProcedureCalls() throws SQLException
01538   {
01539     return ((Boolean) getMetadata(
01540         MetadataDescription.SUPPORTS_SCHEMAS_IN_PROCEDURE_CALLS, null, null,
01541         false)).booleanValue();
01542   }
01543 
01544   /**
01545    * @see java.sql.DatabaseMetaData#supportsSchemasInTableDefinitions()
01546    */
01547   public boolean supportsSchemasInTableDefinitions() throws SQLException
01548   {
01549     return ((Boolean) getMetadata(
01550         MetadataDescription.SUPPORTS_SCHEMAS_IN_TABLE_DEFINITIONS, null, null,
01551         false)).booleanValue();
01552   }
01553 
01554   /**
01555    * @see java.sql.DatabaseMetaData#supportsSelectForUpdate()
01556    */
01557   public boolean supportsSelectForUpdate() throws SQLException
01558   {
01559     return ((Boolean) getMetadata(
01560         MetadataDescription.SUPPORTS_SELECT_FOR_UPDATE, null, null, false))
01561         .booleanValue();
01562   }
01563 
01564   /**
01565    * @see java.sql.DatabaseMetaData#supportsStoredProcedures()
01566    */
01567   public boolean supportsStoredProcedures() throws SQLException
01568   {
01569     return ((Boolean) getMetadata(
01570         MetadataDescription.SUPPORTS_STORED_PROCEDURES, null, null, false))
01571         .booleanValue();
01572   }
01573 
01574   /**
01575    * @see java.sql.DatabaseMetaData#supportsSubqueriesInComparisons()
01576    */
01577   public boolean supportsSubqueriesInComparisons() throws SQLException
01578   {
01579     return ((Boolean) getMetadata(
01580         MetadataDescription.SUPPORTS_SUB_QUERIES_IN_COMPARISONS, null, null,
01581         false)).booleanValue();
01582   }
01583 
01584   /**
01585    * @see java.sql.DatabaseMetaData#supportsSubqueriesInExists()
01586    */
01587   public boolean supportsSubqueriesInExists() throws SQLException
01588   {
01589     return ((Boolean) getMetadata(
01590         MetadataDescription.SUPPORTS_SUB_QUERIES_IN_EXISTS, null, null, false))
01591         .booleanValue();
01592   }
01593 
01594   /**
01595    * @see java.sql.DatabaseMetaData#supportsSubqueriesInIns()
01596    */
01597   public boolean supportsSubqueriesInIns() throws SQLException
01598   {
01599     return ((Boolean) getMetadata(
01600         MetadataDescription.SUPPORTS_SUB_QUERIES_IN_INS, null, null, false))
01601         .booleanValue();
01602   }
01603 
01604   /**
01605    * @see java.sql.DatabaseMetaData#supportsSubqueriesInQuantifieds()
01606    */
01607   public boolean supportsSubqueriesInQuantifieds() throws SQLException
01608   {
01609     return ((Boolean) getMetadata(
01610         MetadataDescription.SUPPORTS_SUB_QUERIES_IN_QUANTIFIEDS, null, null,
01611         false)).booleanValue();
01612   }
01613 
01614   /**
01615    * @see java.sql.DatabaseMetaData#supportsTableCorrelationNames()
01616    */
01617   public boolean supportsTableCorrelationNames() throws SQLException
01618   {
01619     return ((Boolean) getMetadata(
01620         MetadataDescription.SUPPORTS_TABLE_CORRELATION_NAMES, null, null, false))
01621         .booleanValue();
01622   }
01623 
01624   /**
01625    * @see java.sql.DatabaseMetaData#supportsTransactionIsolationLevel(int)
01626    */
01627   public boolean supportsTransactionIsolationLevel(int level)
01628       throws SQLException
01629   {
01630     return ((Boolean) getMetadata(
01631         MetadataDescription.SUPPORTS_TRANSACTION_ISOLATION_LEVEL,
01632         new Class[]{Integer.TYPE}, new Object[]{new Integer(level)}, false))
01633         .booleanValue();
01634   }
01635 
01636   /**
01637    * @see java.sql.DatabaseMetaData#supportsTransactions()
01638    */
01639   public boolean supportsTransactions() throws SQLException
01640   {
01641     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_TRANSACTIONS,
01642         null, null, false)).booleanValue();
01643   }
01644 
01645   /**
01646    * @see java.sql.DatabaseMetaData#supportsUnion()
01647    */
01648   public boolean supportsUnion() throws SQLException
01649   {
01650     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_UNION, null,
01651         null, false)).booleanValue();
01652   }
01653 
01654   /**
01655    * @see java.sql.DatabaseMetaData#supportsUnionAll()
01656    */
01657   public boolean supportsUnionAll() throws SQLException
01658   {
01659     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_UNION_ALL, null,
01660         null, false)).booleanValue();
01661   }
01662 
01663   /**
01664    * @see java.sql.DatabaseMetaData#updatesAreDetected(int)
01665    */
01666   public boolean updatesAreDetected(int type) throws SQLException
01667   {
01668     return ((Boolean) getMetadata(MetadataDescription.UPDATES_ARE_DETECTED,
01669         new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
01670         .booleanValue();
01671   }
01672 
01673   /**
01674    * @see java.sql.DatabaseMetaData#usesLocalFilePerTable()
01675    */
01676   public boolean usesLocalFilePerTable() throws SQLException
01677   {
01678     return ((Boolean) getMetadata(
01679         MetadataDescription.USES_LOCAL_FILE_PER_TABLE, null, null, false))
01680         .booleanValue();
01681   }
01682 
01683   /**
01684    * @see java.sql.DatabaseMetaData#usesLocalFiles()
01685    */
01686   public boolean usesLocalFiles() throws SQLException
01687   {
01688     return ((Boolean) getMetadata(MetadataDescription.USES_LOCAL_FILES, null,
01689         null, false)).booleanValue();
01690   }
01691 
01692   // ------------------- JDBC 3.0 -------------------------
01693 
01694   /**
01695    * @see java.sql.DatabaseMetaData#supportsSavepoints()
01696    */
01697   public boolean supportsSavepoints() throws SQLException
01698   {
01699     return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_SAVEPOINTS,
01700         null, null, false)).booleanValue();
01701   }
01702 
01703   /**
01704    * @see java.sql.DatabaseMetaData#supportsNamedParameters()
01705    */
01706   public boolean supportsNamedParameters() throws SQLException
01707   {
01708     return ((Boolean) getMetadata(
01709         MetadataDescription.SUPPORTS_NAMED_PARAMETERS, null, null, false))
01710         .booleanValue();
01711   }
01712 
01713   /**
01714    * @see java.sql.DatabaseMetaData#supportsMultipleOpenResults()
01715    */
01716   public boolean supportsMultipleOpenResults() throws SQLException
01717   {
01718     return ((Boolean) getMetadata(
01719         MetadataDescription.SUPPORTS_MULTIPLE_OPEN_RESULTS, null, null, false))
01720         .booleanValue();
01721   }
01722 
01723   /**
01724    * @see java.sql.DatabaseMetaData#supportsGetGeneratedKeys()
01725    */
01726   public boolean supportsGetGeneratedKeys() throws SQLException
01727   {
01728     return ((Boolean) getMetadata(
01729         MetadataDescription.SUPPORTS_GET_GENERATED_KEYS, null, null, false))
01730         .booleanValue();
01731   }
01732 
01733   /**
01734    * This function is not supported yet.
01735    * 
01736    * @param catalog a catalog name; "" retrieves those without a catalog;
01737    *          <code>null</code> means drop catalog name from the selection
01738    *          criteria
01739    * @param schemaPattern a schema name pattern; "" retrieves those without a
01740    *          schema
01741    * @param typeNamePattern a UDT name pattern; may be a fully-qualified name
01742    * @return a <code>ResultSet</code> object in which a row gives information
01743    *         about the designated UDT
01744    * @throws SQLException if a database access error occurs
01745    * @since JDK 1.4
01746    */
01747   public java.sql.ResultSet getSuperTypes(String catalog, String schemaPattern,
01748       String typeNamePattern) throws SQLException
01749   {
01750     throw new NotImplementedException("getSuperTypes");
01751   }
01752 
01753   /**
01754    * This function is not supported yet.
01755    * 
01756    * @param catalog a catalog name; "" retrieves those without a catalog;
01757    *          <code>null</code> means drop catalog name from the selection
01758    *          criteria
01759    * @param schemaPattern a schema name pattern; "" retrieves those without a
01760    *          schema
01761    * @param tableNamePattern a table name pattern; may be a fully-qualified name
01762    * @return a <code>ResultSet</code> object in which each row is a type
01763    *         description
01764    * @throws SQLException if a database access error occurs
01765    * @since JDK 1.4
01766    */
01767   public java.sql.ResultSet getSuperTables(String catalog,
01768       String schemaPattern, String tableNamePattern) throws SQLException
01769   {
01770     throw new NotImplementedException("getSuperTables");
01771   }
01772 
01773   /**
01774    * This function is not supported yet.
01775    * 
01776    * @param catalog a catalog name; must match the catalog name as it is stored
01777    *          in the database; "" retrieves those without a catalog;
01778    *          <code>null</code> means that the catalog name should not be used
01779    *          to narrow the search
01780    * @param schemaPattern a schema name pattern; must match the schema name as
01781    *          it is stored in the database; "" retrieves those without a schema;
01782    *          <code>null</code> means that the schema name should not be used
01783    *          to narrow the search
01784    * @param typeNamePattern a type name pattern; must match the type name as it
01785    *          is stored in the database
01786    * @param attributeNamePattern an attribute name pattern; must match the
01787    *          attribute name as it is declared in the database
01788    * @return a <code>ResultSet</code> object in which each row is an attribute
01789    *         description
01790    * @exception SQLException if a database access error occurs
01791    * @since JDK 1.4
01792    */
01793   public java.sql.ResultSet getAttributes(String catalog, String schemaPattern,
01794       String typeNamePattern, String attributeNamePattern) throws SQLException
01795   {
01796     throw new NotImplementedException("getAttributes");
01797   }
01798 
01799   /**
01800    * @see java.sql.DatabaseMetaData#getResultSetHoldability()
01801    */
01802   public int getResultSetHoldability() throws SQLException
01803   {
01804     return ((Integer) getMetadata(
01805         MetadataDescription.GET_RESULTSET_HOLDABILITY, null, null, false))
01806         .intValue();
01807   }
01808 
01809   /**
01810    * @see java.sql.DatabaseMetaData#getDatabaseMajorVersion()
01811    */
01812   public int getDatabaseMajorVersion() throws SQLException
01813   {
01814     return ((Integer) getMetadata(
01815         MetadataDescription.GET_DATABASE_MAJOR_VERSION, null, null, false))
01816         .intValue();
01817   }
01818 
01819   /**
01820    * @see java.sql.DatabaseMetaData#getDatabaseMinorVersion()
01821    */
01822   public int getDatabaseMinorVersion() throws SQLException
01823   {
01824     return ((Integer) getMetadata(
01825         MetadataDescription.GET_DATABASE_MINOR_VERSION, null, null, false))
01826         .intValue();
01827   }
01828 
01829   /**
01830    * Retrieves the major JDBC version number for this driver.
01831    * 
01832    * @return JDBC version major number
01833    * @exception SQLException if a database access error occurs
01834    * @since JDK 1.4
01835    */
01836   public int getJDBCMajorVersion() throws SQLException
01837   {
01838     return Driver.MAJOR_VERSION;
01839   }
01840 
01841   /**
01842    * Retrieves the minor JDBC version number for this driver.
01843    * 
01844    * @return JDBC version minor number
01845    * @exception SQLException if a database access error occurs
01846    * @since JDK 1.4
01847    */
01848   public int getJDBCMinorVersion() throws SQLException
01849   {
01850     return Driver.MINOR_VERSION;
01851   }
01852 
01853   /**
01854    * @see java.sql.DatabaseMetaData#getSQLStateType()
01855    */
01856   public int getSQLStateType() throws SQLException
01857   {
01858     return ((Integer) getMetadata(MetadataDescription.GET_SQL_STATE_TYPE, null,
01859         null, false)).intValue();
01860   }
01861 
01862   /**
01863    * @see java.sql.DatabaseMetaData#locatorsUpdateCopy()
01864    */
01865   public boolean locatorsUpdateCopy() throws SQLException
01866   {
01867     return ((Boolean) getMetadata(MetadataDescription.LOCATORS_UPDATE_COPY,
01868         null, null, false)).booleanValue();
01869   }
01870 
01871   /**
01872    * @see java.sql.DatabaseMetaData#supportsStatementPooling()
01873    */
01874   public boolean supportsStatementPooling() throws SQLException
01875   {
01876     return ((Boolean) getMetadata(
01877         MetadataDescription.SUPPORTS_STATEMENT_POOLING, null, null, false))
01878         .booleanValue();
01879   }
01880 }

Generated on Mon Apr 11 22:01:31 2005 for C-JDBC by  doxygen 1.3.9.1