devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/* Copyright (c) 2001-2004, The HSQL Development Group
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of the HSQL Development Group nor the names of its
 * contributors may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, 
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


package org.hsqldb.jdbc;

import org.hsqldb.lib.StringUtil;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.hsqldb.Trace;
import org.hsqldb.Library;
import org.hsqldb.Column;

// fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
// JDBC 2 methods can now be called from jdk 1.1.x - see javadoc comments
// boucherb@users 20020509 - added "throws SQLException" to all methods where
// it was missing here but specified in the java.sql.DatabaseMetaData interface,
// updated generic documentation to JDK 1.4, and added JDBC3 methods and docs
// boucherb@users and fredt@users 20020409/20020505 extensive review and update
// of docs and behaviour to comply with previous and latest java.sql
// specification
// boucherb@users 2002-20030121 - extensive rewrite to support new
// 1.7.2 metadata features.
// boucherb@users 20040422 - doc 1.7.2 - javadoc updates toward 1.7.2 final
// boucherb@users 200404xx - misc changes

/** Comprehensive information about the database as a whole.
 * 

* This interface is implemented by driver vendors to let users know the * capabilities of a Database Management System (DBMS) in combination with * the driver based on JDBCTM technology * ("JDBC driver") that is used with it. Different relational DBMSs often * support different features, implement features in different ways, and use * different data types. In addition, a driver may implement a feature on * top of what the DBMS offers. Information returned by methods in this * interface applies to the capabilities of a particular driver and a * particular DBMS working together. Note that as used in this documentation, * the term "database" is used generically to refer to both the driver and DBMS. *

* A user for this interface is commonly a tool that needs to discover how to * deal with the underlying DBMS. This is especially true for applications * that are intended to be used with more than one DBMS. For example, a tool * might use the method getTypeInfo to find out what data types * can be used in a CREATE TABLE statement. Or a user might call * the method supportsCorrelatedSubqueries to see if it is possible * to use a correlated subquery or supportsBatchUpdates to see if * it is possible to use batch updates. *

* Some DatabaseMetaData methods return lists of information * in the form of ResultSet objects. Regular ResultSet * methods, such as getString and getInt, can be used * to retrieve the data from these ResultSet objects. If a given * form of metadata is not available, the ResultSet getter methods * throw an SQLException. *

* Some DatabaseMetaData methods take arguments that are * String patterns. These arguments all have names such as fooPattern. * Within a pattern String, "%" means match any substring of 0 or more * characters, and "_" means match any one character. Only metadata * entries matching the search pattern are returned. If a search pattern * argument is set to null, that argument's criterion will * be dropped from the search. *

* A method that gets information about a feature that the driver does not * support will throw an SQLException. * In the case of methods that return a ResultSet * object, either a ResultSet object (which may be empty) is * returned or an SQLException is thrown.

* * *

*

HSQLDB-Specific Information:

* * Starting with HSQLDB 1.7.2, an option is provided to allow alternate * system table production implementations. In this distribution, there are * three implementations whose behaviour ranges from producing no system * tables at all to producing a richer and more complete body of information * about an HSQLDB database than was previously available. The information * provided through the default implementation is, unlike previous * versions, accessible to all database users, regardless of admin status. * This is now possible because the table content it produces for each * user is pre-filtered, based on the user's access rights. That is, each * system table now acts like a security-aware View.

* * The process of installing a system table production class is transparent and * occurs dynamically at runtime during the opening sequence of a * Database instance, in the newDatabaseInformation() factory * method of the revised DatabaseInformation class, using the following * steps:

* *

*
    *
  1. If a class whose fully qualified name is org.hsqldb.DatabaseInformationFull * can be found and it has an accesible constructor that takes an * org.hsqldb.Database object as its single parameter, then an instance of * that class is reflectively instantiated and is used by the database * instance to produce its system tables.

    * *

  2. If 1.) fails, then the process is repeated, attempting to create an * instance of org.hsqldb.DatabaseInformationMain (which provides just the * core set of system tables required to service this class, but now does * so in a more security aware and comprehensive fashion).

    * *

  3. If 2.) fails, then an instance of org.hsqldb.DatabaseInformation is * installed (that, by default, produces no system tables, meaning that * calls to all related methods in this class will fail, throwing an * SQLException stating that a required system table is not found).

    * *

*

* * The process of searching for alternate implementations of database * support classes, ending with the installation of a minimal but functional * default will be refered to henceforth as graceful degradation. * This process is advantageous in that it allows developers and administrators * to easily choose packaging options, simply by adding to or deleting concerned * classes from an HSQLDB installation, without worry over providing complex * initialization properties or disrupting the core operation of the engine. * In this particular context, graceful degradation allows easy choices * regarding database metadata, spanning the range of full (design-time), * custom-written, minimal (production-time) or null * (space-constrained) system table production implementations.

* * In the default full implementation, a number of new system tables are * provided that, although not used directly by this class, present previously * unavailable information about the database, such as about its triggers and * aliases.

* * In order to better support graphical database exploration tools and as an * experimental intermediate step toward more fully supporting SQL9n and * SQL200n, the default installed DatabaseInformation implementation * is also capable of reporting pseudo name space information, such as * the catalog (database URI) and pseudo-schema of database objects.

* * The catalog and schema reporting features are turned off by default but * can be turned on by providing the appropriate entries in the database * properties file (see the advanced topics section of the product * documentation).

* * When the features are turned on, catalogs and schemas are reported using * the following conventions:

* *

    *
  1. All objects are reported as having a catalog equal to the URI of the * database, which is equivalent to the catenation of the * <type> and <path> portions of the HSQLDB * internal JDBC connection URL.

    * * Examples:

    * *

     *     "jdbc:hsqldb:file:test"      => "file:test"
     *     "jdbc:hsqldb:mem:."          => "mem:."
     *     "jdbc:hsqldb:hsql:/host/..." => URI of aliased database
     *     "jdbc:hsqldb:http:/host/..." => URI of aliased database
     *     
    * * Note: No provision is made for qualifying database objects * by catalog in DML or DDL SQL. This feature is functional only with * respect to browsing the database through the DatabaseMetaData and system * table interfaces.

    * *

  2. The schemas are reported using the following rules:

    * *

    *
      *
    1. System object => "DEFINITION_SCHEMA"

      * *

    2. Temp object => <user-name> (e.g. temp [text] tables)

      * *

    3. Non-temp user object (not 1.) or 2.) above) => "PUBLIC"

      * *

    4. INFORMATION_SCHEMA is reported in the getSchemas() result * and is reserved for future use against system view objects, * although no objects are currently reported in it.

      * *

    *

    * *

  3. Schema qualified name resolution is provided by the default * implemenation so that each database object can be accessed * while browsing the JDBC DatabaseMetaData alternately * by either its simple identifier or by:

    * *

     *      <schema-name>.<ident>
     *      
    * * A limitation imposed by the current version of the Tokenizer, * Parser and Database is that only qualification of tables by schema * is supported with the schema reporting feature turned on and only for * DML, not DDL. For example, column qualifications of the form:

    * *

     *      <schema-name>.<table-name>.<column-name>
     *      
    * * are not supported and table qualifications of the form:

    * *

     *      CREATE TABLE <schema-name>.<table-name> ...
     *      
    * * are not supported either, but SQL of the form:

    * *

     *      SELECT
     *          <table-name>.<column-name>, ...
     *      FROM
     *          <schema-name>.<table-name>, ...
     *      
    * * where column names are qualified only by table name but table names in * the table list are additionally qualified by schema name is * supported.

    * * This limitation will defintiely cause problems with most visual query * building tools where full qualification is typically used for all * objects. It may be possible to work around this by adjusting the SQL * creation settings on a product-by-product basis, but it is recommended * instead simply to ensure that the currently experimental catalog and * schema reporting are both turned off while using such tools or any * other software that builds SQL using DatabaseMetaData.

    *

* * Again, it should be well understood that these features provide an * emulation of catalog and schema support and are intended only * as an experimental implementation to enhance the browsing experience * when using graphical database explorers and to make a first foray * into tackling the issue of implementing true schema and catalog support * in the future. That is, all database objects are still in reality * located in a single unqualified name space and no provision has yet * been made either to allow creation of schemas or catalogs or to * allow qualification, by schema or catalog, of database objects other * than tables and views, and then only using schema qualification in * table DROP/ALTER DDL and in SELECT DML table lists and INSERT, UPDATE * and DELETE DML table specifications.

* * Due the nature of the new database system table production process, fewer * assumptions can be made by this class about what information is made * available in the system tables supporting DatabaseMetaData * methods. Because of this, the SQL queries behind the ResultSet * producing methods have been cleaned up and made to adhere more strictly to * the JDBC contracts specified in relation to the method parameters.

* * One of the remaining assumptions concerns the approximate * argument of {@link #getIndexInfo getIndexInfo()}. This parameter is still * ignored since there is not yet any process in place to internally gather * and persist table and index statistics. A primitive version of a statistics * gathering and reporting subsystem may be introduced some time in the * 1.7.x series of releases, but no hard decision has yet been made.

* * Another assumption is that simple select queries against certain system * tables will return rows in JDBC contract order in the absence of an * "ORDER BY" clause. The reason for this is that results * come back much faster when no "ORDER BY" clause is used. * Developers wishing to extend or replace an existing system table production * class should be aware of this, either adding the contract * "ORDER BY" clause to the SQL in corresponding methods in this class, * or, better, by maintaing rows in the correct order in the underlying * system tables, prefereably by creating appropriate primary indices.

* *


* * JRE 1.1.x Notes:

* * In general, JDBC 2 support requires Java 1.2 and above, and JDBC3 requires * Java 1.4 and above. In HSQLDB, support for methods introduced in different * versions of JDBC depends on the JDK version used for compiling and building * HSQLDB.

* * Since 1.7.0, it is possible to build the product so that * all JDBC 2 methods can be called while executing under the version 1.1.x * Java Runtime EnvironmentTM. * However, some of these method calls require int values that * are defined only in the JDBC 2 or greater version of * * ResultSet interface. For this reason, when the * product is compiled under JDK 1.1.x, these values are defined in * {@link jdbcResultSet jdbcResultSet}.

* * In a JRE 1.1.x environment, calling JDBC 2 methods that take or return the * JDBC2-only ResultSet values can be achieved by referring * to them in parameter specifications and return value comparisons, * respectively, as follows:

* *

 * jdbcResultSet.FETCH_FORWARD
 * jdbcResultSet.TYPE_FORWARD_ONLY
 * jdbcResultSet.TYPE_SCROLL_INSENSITIVE
 * jdbcResultSet.CONCUR_READ_ONLY
 * // etc
 * 
* * However, please note that code written in such a manner will not be * compatible for use with other JDBC 2 drivers, since they expect and use * ResultSet, rather than jdbcResultSet. Also * note, this feature is offered solely as a convenience to developers * who must work under JDK 1.1.x due to operating constraints, yet wish to * use some of the more advanced features available under the JDBC 2 * specification.

* * (fredt@users)
* (boucherb@users) *

* * * @author boucherb@users * @author fredt@users * @version 1.7.2 * @see org.hsqldb.DatabaseInformation * @see org.hsqldb.DatabaseInformationMain * @see org.hsqldb.DatabaseInformationFull */ public class jdbcDatabaseMetaData implements java.sql.DatabaseMetaData { /** Used by getBestRowIdentifier to avoid extra object construction */ final static Integer INT_COLUMNS_NO_NULLS = new Integer(columnNoNulls); // ----------------------------------------------------------------------- // private attributes // ----------------------------------------------------------------------- /** * The connection this object uses to retrieve database instance-specific * metadata. */ private jdbcConnection connection; /** * A CSV list representing the SQL IN list to use when generating * queries for getBestRowIdentifier when the * scope argument is bestRowSession. * @since HSQLDB 1.7.2 */ private static final String BRI_SESSION_SCOPE_IN_LIST = "(" + bestRowSession + ")"; /** * A CSV list representing the SQL IN list to use when generating * queries for getBestRowIdentifier when the * scope argument is bestRowTemporary. * @since HSQLDB 1.7.2 */ private static final String BRI_TEMPORARY_SCOPE_IN_LIST = "(" + bestRowTemporary + "," + bestRowTransaction + "," + bestRowSession + ")"; /** * A CSV list representing the SQL IN list to use when generating * queries for getBestRowIdentifier when the * scope argument is bestRowTransaction. * @since HSQLDB 1.7.2 */ private static final String BRI_TRANSACTION_SCOPE_IN_LIST = "(" + bestRowTransaction + "," + bestRowSession + ")"; /** * "SELECT * FROM ".

* * This attribute is in support of methods that use SQL SELECT statements to * generate returned ResultSet objects.

* * @since HSQLDB 1.7.2 */ private static final String selstar = "SELECT * FROM "; /** * " WHERE 1=1 ".

* * This attribute is in support of methods that use SQL SELECT statements to * generate returned ResultSet objects.

* * A good optimizer will simply drop this when parsing a condition * expression. And it makes our code much easier to write, since we don't * have to check our "WHERE" clause productions as strictly for proper * conjunction: we just stick additional conjunctive predicates on the * end of this and Presto! Everything works :-)

* @since HSQLDB 1.7.2 */ private static final String whereTrue = " WHERE 1=1"; //---------------------------------------------------------------------- // First, a variety of minor information about the target database. /** * Retrieves whether the current user can call all the procedures * returned by the method getProcedures.

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.1, HSQLDB does not return any rows from * getProcedures. However, * allProceduresAreCallable always returns * true. This is simply meant to indicate that all users * can call all stored procedures made available by default in a newly * created HSQLDB database.

* * Since 1.7.2, HSQLDB provides an option to plug in varying degrees of * support. However, this method still always returns * true.

* * In a future release, the plugin interface may be modified to allow * implementors to report different values here, based on their * implementations. *

* * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean allProceduresAreCallable() throws SQLException { return true; } /** * Retrieves whether the current user can use all the tables returned * by the method getTables in a SELECT * statement.

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.1, HSQLDB throws an exception when a non-admin user * without explicit grant of SELECT on * SYSTEM_TABLES invokes getTables. Conversely, * all admin users have implict ALL on all tables. As a * comprimise, this method always returns true. * However, if a non-admin user is granted SELECT on * SYSTEM_TABLES, then it is possible for that user to be * denied SELECT access to some of the tables listed in * response to their invoking getTables.

* * Since 1.7.2, there is an option to plug in system table support * that provides getTables() results with greater or lesser degrees of * detail and accuracy.

* * Regardless, 1.7.2 reports true here, always. * Therefore, it is possible that the reported value is not accurate.

* * Please note that the default 1.7.2 getTables behaviour is * omit from the list of requested tables only those to which the * invoking user has no access of any kind.

* * In a future release, the system table producer plugin interface may be * modified to allow implementors to report different values here based on * their implementatons.

*

* * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean allTablesAreSelectable() throws SQLException { return true; } /** * Retrieves the URL for this DBMS. * * * @return the URL for this DBMS or null if it cannot be * generated * @exception SQLException if a database access error occurs */ public String getURL() throws SQLException { return connection.getURL(); } /** * Retrieves the user name as known to this database. * * * @return the database user name * @exception SQLException if a database access error occurs */ public String getUserName() throws SQLException { ResultSet r = execute("CALL USER()"); r.next(); return r.getString(1); } /** * Retrieves whether this database is in read-only mode.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.1, this is a synonym for * {@link jdbcConnection#isReadOnly()} and does not report on * the global read-only state of the database.

* * Starting with 1.7.2, this behaviour is corrected by issuing * an SQL call to the new {@link Library#isReadOnlyDatabase} method * which provides correct determination of the read-only status for * both local and remote database instances. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean isReadOnly() throws SQLException { ResultSet r = execute("CALL \"org.hsqldb.Library.isReadOnlyDatabase\"()"); r.next(); return r.getBoolean(1); } /** * Retrieves whether NULL values are sorted high. * Sorted high means that NULL values * sort higher than any other value in a domain. In an ascending order, * if this method returns true, NULL values * will appear at the end. By contrast, the method * nullsAreSortedAtEnd indicates whether NULL values * are sorted at the end regardless of sort order.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB sorts null low; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean nullsAreSortedHigh() throws SQLException { return false; } /** * Retrieves whether NULL values are sorted low. * Sorted low means that NULL values * sort lower than any other value in a domain. In an ascending order, * if this method returns true, NULL values * will appear at the beginning. By contrast, the method * nullsAreSortedAtStart indicates whether NULL values * are sorted at the beginning regardless of sort order.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB sorts null low; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean nullsAreSortedLow() throws SQLException { return true; } /** * Retrieves whether NULL values are sorted at the start regardless * of sort order.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB sorts null low; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean nullsAreSortedAtStart() throws SQLException { return false; } /** * Retrieves whether NULL values are sorted at the end regardless of * sort order.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB sorts null low; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean nullsAreSortedAtEnd() throws SQLException { return false; } /** * Retrieves the name of this database product.

* *

*

HSQLDB-Specific Information:

* * Starting with HSQLDB 1.7.2, this value is retrieved through an * SQL call to the new {@link Library#getDatabaseProductName} method * which allows correct determination of the database product name * for both local and remote database instances. *

* * @return database product name * @exception SQLException if a database access error occurs */ public String getDatabaseProductName() throws SQLException { ResultSet rs = execute("call \"org.hsqldb.Library.getDatabaseProductName\"()"); rs.next(); return rs.getString(1); } /** * Retrieves the version number of this database product.

* *

*

HSQLDB-Specific Information:

* * Starting with HSQLDB 1.7.2, this value is retrieved through an * SQL call to the new {@link Library#getDatabaseProductVersion} method * which allows correct determination of the database product name * for both local and remote database instances. *

* * @return database version number * @exception SQLException if a database access error occurs */ public String getDatabaseProductVersion() throws SQLException { ResultSet rs = execute( "call \"org.hsqldb.Library.getDatabaseProductVersion\"()"); rs.next(); return rs.getString(1); } /** * Retrieves the name of this JDBC driver. * * @return JDBC driver name * @exception SQLException if a database access error occurs */ public String getDriverName() throws SQLException { return jdbcUtil.PRODUCT + " Driver"; } /** * Retrieves the version number of this JDBC driver as a String. * * @return JDBC driver version * @exception SQLException if a database access error occurs */ public String getDriverVersion() throws SQLException { return jdbcUtil.VERSION; } /** * Retrieves this JDBC driver's major version number. * * @return JDBC driver major version */ public int getDriverMajorVersion() { return jdbcUtil.MAJOR; } /** * Retrieves this JDBC driver's minor version number. * * @return JDBC driver minor version number */ public int getDriverMinorVersion() { return jdbcUtil.MINOR; } /** * Retrieves whether this database stores tables in a local file.

* * *

*

HSQLDB-Specific Information:

* * From HSQLDB 1.7.2 it is assumed that this refers to data being stored * by the JDBC client. This method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean usesLocalFiles() throws SQLException { return false; } /** * Retrieves whether this database uses a file for each table.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not use a file for each table. * This method always returns false. *

* * @return true if this database uses a local file for each table; * false otherwise * @exception SQLException if a database access error occurs */ public boolean usesLocalFilePerTable() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case unquoted SQL identifiers as * case sensitive and as a result stores them in mixed case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsMixedCaseIdentifiers() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case unquoted SQL identifiers as * case insensitive and stores them in upper case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesUpperCaseIdentifiers() throws SQLException { return true; } /** * Retrieves whether this database treats mixed case unquoted SQL identifiers as * case insensitive and stores them in lower case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesLowerCaseIdentifiers() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case unquoted SQL identifiers as * case insensitive and stores them in mixed case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesMixedCaseIdentifiers() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case quoted SQL identifiers as * case sensitive and as a result stores them in mixed case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException { return true; // InterBase (iscdrv32.dll) returns false } /** * Retrieves whether this database treats mixed case quoted SQL identifiers as * case insensitive and stores them in upper case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesUpperCaseQuotedIdentifiers() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case quoted SQL identifiers as * case insensitive and stores them in lower case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesLowerCaseQuotedIdentifiers() throws SQLException { return false; } /** * Retrieves whether this database treats mixed case quoted SQL identifiers as * case insensitive and stores them in mixed case.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive and stores * them in upper case. It treats quoted identifiers as case sensitive and * stores them verbatim; this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean storesMixedCaseQuotedIdentifiers() throws SQLException { return false; // No: as case sensitive. } /** * Retrieves the string used to quote SQL identifiers. * This method returns a space " " if identifier quoting is not supported.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB uses the standard SQL identifier quote character * (the double quote character); this method always returns ". *

* * @return the quoting string or a space if quoting is not supported * @exception SQLException if a database access error occurs */ public String getIdentifierQuoteString() throws SQLException { return "\""; // InterBase (iscdrv32.dll) returns "" } //fredt@users 20020429 - JavaDoc comment - in 1.7.1 there are keywords such // as TEMP, TEXT, CACHED that are not SQL 92 keywords /** * Retrieves a comma-separated list of all of this database's SQL keywords * that are NOT also SQL92 keywords.

* * *

*

HSQLDB-Specific Information:

* * The list returned contains HSQLDB keywords that are not in the list * of reserved words. Some of these are in the list of potential reserved * words that are not SQL92 keywords, but are reported in the * standard as possible future SQL keywords. *

* * * * @return the list of this database's keywords that are not also * SQL92 keywords * @exception SQLException if a database access error occurs */ public String getSQLKeywords() throws SQLException { return "BEFORE,BIGINT,BINARY,CACHED,DATETIME," + "LIMIT,LONGVARBINARY,LONGVARCHAR,OBJECT,OTHER,SAVEPOINT," + "TEMP,TEXT,TOP,TRIGGER,TINYINT,VARBINARY,VARCHAR_IGNORECASE"; } /** * Retrieves a comma-separated list of math functions available with * this database. These are the Open Group CLI math function names used in * the JDBC function escape clause. * @return the list of math functions supported by this database * @exception SQLException if a database access error occurs */ public String getNumericFunctions() throws SQLException { return StringUtil.getList(Library.sNumeric, ",", ""); } /** * Retrieves a comma-separated list of string functions available with * this database. These are the Open Group CLI string function names used * in the JDBC function escape clause. * @return the list of string functions supported by this database * @exception SQLException if a database access error occurs */ public String getStringFunctions() throws SQLException { return StringUtil.getList(Library.sString, ",", ""); } /** * Retrieves a comma-separated list of system functions available with * this database. These are the Open Group CLI system function names used * in the JDBC function escape clause. * @return a list of system functions supported by this database * @exception SQLException if a database access error occurs */ public String getSystemFunctions() throws SQLException { return StringUtil.getList(Library.sSystem, ",", ""); } /** * Retrieves a comma-separated list of the time and date functions available * with this database. * @return the list of time and date functions supported by this database * @exception SQLException if a database access error occurs */ public String getTimeDateFunctions() throws SQLException { return StringUtil.getList(Library.sTimeDate, ",", ""); } /** * Retrieves the string that can be used to escape wildcard characters. * This is the string that can be used to escape '_' or '%' in * the catalog search parameters that are a pattern (and therefore use one * of the wildcard characters). * *

The '_' character represents any single character; * the '%' character represents any sequence of zero or * more characters.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB uses the "\" character to escape wildcard characters. *

* * * * @return the string used to escape wildcard characters * @exception SQLException if a database access error occurs */ public String getSearchStringEscape() throws SQLException { return "\\"; } /** * Retrieves all the "extra" characters that can be used in unquoted * identifier names (those beyond a-z, A-Z, 0-9 and _).

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not support using any "extra" characters in unquoted * identifier names; this method always returns the empty String. *

* * * * @return the string containing the extra characters * @exception SQLException if a database access error occurs */ public String getExtraNameCharacters() throws SQLException { return ""; } //-------------------------------------------------------------------- // Functions describing which features are supported. /** * Retrieves whether this database supports ALTER TABLE * with add column.

* * *

*

HSQLDB-Specific Information:

* * From 1.7.0, HSQLDB supports this type of * ALTER TABLE statement; this method always * returns true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsAlterTableWithAddColumn() throws SQLException { return true; } /** * Retrieves whether this database supports ALTER TABLE * with drop column.

* * *

*

HSQLDB-Specific Information:

* * From 1.7.0, HSQLDB supports this type of * ALTER TABLE statement; this method always * returns true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsAlterTableWithDropColumn() throws SQLException { return true; } /** * Retrieves whether this database supports column aliasing. * *

If so, the SQL AS clause can be used to provide names for * computed columns or to provide alias names for columns as * required.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports column aliasing; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsColumnAliasing() throws SQLException { return true; // InterBase (iscdrv32.dll) returns false } /** * Retrieves whether this database supports concatenations between * NULL and non-NULL values being * NULL.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports this; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean nullPlusNonNullIsNull() throws SQLException { return true; // Access (odbcjt32.dll) returns false } /** * Retrieves whether this database supports the CONVERT * function between SQL types.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports conversions; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsConvert() throws SQLException { return true; } // fredt@users - JD comment - I think this is unsupported at the moment // because SQL92 says conversion is implementation dependent, so if // conversion from DOUBLE to INTEGER were possbible we would return the // whole number part, but we currently throw. I'm not so sure about // conversions between string and numeric where it is logically possible // only if the string represents a numeric value /** * Retrieves whether this database supports the CONVERT * for two given SQL types.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports conversion though String intermediates, so everything * should be possible, short of number format errors (all Java objects * have a toString method); this method always returns true. *

* * * * @param fromType the type to convert from; one of the type codes from * the class java.sql.Types * @param toType the type to convert to; one of the type codes from * the class java.sql.Types * @return true if so; false otherwise * @exception SQLException if a database access error occurs * @see java.sql.Types */ public boolean supportsConvert(int fromType, int toType) throws SQLException { return true; } /** * Retrieves whether this database supports table correlation names.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports table correlation names; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsTableCorrelationNames() throws SQLException { return true; } /** * Retrieves whether, when table correlation names are supported, they * are restricted to being different from the names of the tables.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB requires that table correlation names are different from the * names of the tables; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsDifferentTableCorrelationNames() throws SQLException { return true; } /** * Retrieves whether this database supports expressions in * ORDER BY lists.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports expressions in ORDER BY lists; this * method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsExpressionsInOrderBy() throws SQLException { return true; } /** * Retrieves whether this database supports using a column that is * not in the SELECT statement in an * ORDER BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports using a column that is not in the SELECT * statement in an ORDER BY clause; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsOrderByUnrelated() throws SQLException { return true; } /** * Retrieves whether this database supports some form of * GROUP BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports using the GROUP BY clause; this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsGroupBy() throws SQLException { return true; } /** * Retrieves whether this database supports using a column that is * not in the SELECT statement in a * GROUP BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports using a column that is * not in the SELECT statement in a * GROUP BY clause; this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsGroupByUnrelated() throws SQLException { return true; } /** * Retrieves whether this database supports using columns not included in * the SELECT statement in a GROUP BY clause * provided that all of the columns in the SELECT statement * are included in the GROUP BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports using columns not included in * the SELECT statement in a GROUP BY clause * provided that all of the columns in the SELECT statement * are included in the GROUP BY clause; this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsGroupByBeyondSelect() throws SQLException { return true; } /** * Retrieves whether this database supports specifying a * LIKE escape clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports specifying a * LIKE escape clause; this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsLikeEscapeClause() throws SQLException { return true; } /** * Retrieves whether this database supports getting multiple * ResultSet objects from a single call to the * method execute.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support getting multiple * ResultSet objects from a single call to the * method execute; this method * always returns false.

* * This behaviour may change in a future release. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsMultipleResultSets() throws SQLException { return false; } /** * Retrieves whether this database allows having multiple * transactions open at once (on different connections).

* * *

*

HSQLDB-Specific Information:

* * HSQLDB allows having multiple * transactions open at once (on different connections); this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsMultipleTransactions() throws SQLException { return true; } /** * Retrieves whether columns in this database may be defined as * non-nullable.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports the specification of non-nullable columns; this method * always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsNonNullableColumns() throws SQLException { return true; } /** * Retrieves whether this database supports the ODBC Minimum SQL grammar.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support the ODBC * Minimum SQL grammar; this method * always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsMinimumSQLGrammar() throws SQLException { return false; } /** * Retrieves whether this database supports the ODBC Core SQL grammar.

* * *

*

HSQLDB-Specific Information:

* * From 1.7.2 this method always returns true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCoreSQLGrammar() throws SQLException { return true; } /** * Retrieves whether this database supports the ODBC Extended SQL grammar.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support the ODBC * Extended SQL grammar; this method * always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsExtendedSQLGrammar() throws SQLException { return false; } /** * Retrieves whether this database supports the ANSI92 entry level SQL * grammar.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support the ANSI92 entry * level SQL grammar; this method * always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsANSI92EntryLevelSQL() throws SQLException { return false; } /** * Retrieves whether this database supports the ANSI92 intermediate SQL * grammar supported.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support the ANSI92 * intermediate SQL grammar; this method always returns * false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsANSI92IntermediateSQL() throws SQLException { return false; } /** * Retrieves whether this database supports the ANSI92 full SQL * grammar supported.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support the ANSI92 * full SQL grammar; this method always returns * false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsANSI92FullSQL() throws SQLException { return false; } // fredt@users 20030413 - return value change to support OpenOffice.org /** * Retrieves whether this database supports the SQL Integrity * Enhancement Facility.

* * *

*

HSQLDB-Specific Information:

* * From 1.7.2, this method always returns * true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsIntegrityEnhancementFacility() throws SQLException { return true; } /** * Retrieves whether this database supports some form of outer join.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports outer joins; this method always returns * true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsOuterJoins() throws SQLException { return true; } /** * Retrieves whether this database supports full nested outer joins.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support full nested outer * joins; this method always returns false.

* * This behaviour may change in a future release. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsFullOuterJoins() throws SQLException { return false; } /** * Retrieves whether this database provides limited support for outer * joins. (This will be true if the method * supportsFullOuterJoins returns true).

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB support the LEFT OUTER join syntax; * this method always returns true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsLimitedOuterJoins() throws SQLException { return true; } /** * Retrieves the database vendor's preferred term for "schema".

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.1, HSQLDB does not support schemas; * this method always returns the empty String.

* * Starting with 1.7.2, HSQLDB provides an option to plug in support for * different metadata implementations. Using the default * DatabaseInformationFull plugin, schema support is turned * off by default, but there is an option to turn on support for * SQL92-like schema reporting (system objects such as * system tables and built-in routines are reported in a schema named * "DEFINITION_SCHEMA" while user objects such as regular tables and views are * reported in a schema named "PUBLIC"). However, this feature is * experimental and there is still no support for creating or dropping schemas, * choosing the schema in which to create other database objects or really * any other support beyond schema qualification for table ALTER/DROP DDL and * SELECT tables lists. As such, this method still returns the empty String. *

* * @return the vendor term for "schema" * @exception SQLException if a database access error occurs */ public String getSchemaTerm() throws SQLException { return ""; } /** * Retrieves the database vendor's preferred term for "procedure".

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support declaration of * functions or procedures directly in SQL but instead relies on the * HSQLDB-specific CLASS grant mechanism to make public static * Java methods available as SQL routines; this method always returns * an empty String. *

* * @return the vendor term for "procedure" * @exception SQLException if a database access error occurs */ public String getProcedureTerm() throws SQLException { return ""; } /** * Retrieves the database vendor's preferred term for "catalog".

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.2, HSQLDB does not support catalogs in DDL or DML; * this method always returns the empty String. *

* * * @return the vendor term for "catalog" * @exception SQLException if a database access error occurs */ public String getCatalogTerm() throws SQLException { return ""; } /** * Retrieves whether a catalog appears at the start of a fully qualified * table name. If not, the catalog appears at the end.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalogs in DDL or DML; * this method always returns false. *

* * @return true if the catalog name appears at the beginning * of a fully qualified table name; false otherwise * @exception SQLException if a database access error occurs */ public boolean isCatalogAtStart() throws SQLException { return false; } /** * Retrieves the String that this database uses as the * separator between a catalog and table name.

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.2, HSQLDB does not support catalogs in DDL or DML; * this method always returns an empty String. *

* * * @return the separator string * @exception SQLException if a database access error occurs */ public String getCatalogSeparator() throws SQLException { return ""; } /** * Retrieves whether a schema name can be used in a data * manipulation statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.1, HSQLDB does not support schemas; * this method always returns false. * * Starting with 1.7.2, HSQLDB provides an option to plug in support for * different metadata implementations. Using the default * DatabaseInformationFull plugin, schema support is turned off by * default, but there is an option to turn on SQL92-like schema reporting * (system objects such as system tables and built-in routines are reported in * a schema named "DEFINITION_SCHEMA" while user objects such as regular tables * and views are reported in a schema named "PUBLIC." However, this feature is * experimental and there is still no support for creating or dropping schemas, * choosing the schema in which to create other database objects or really * any other support beyond schema qualification for table ALTER/DROP DDL and * SELECT tables lists. As such, this method still returns * false.

* * In the a future release, it is intended to provide core support for * schema-qualified table and column identifiers, at which point this method * will always return true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSchemasInDataManipulation() throws SQLException { return false; } /** * Retrieves whether a schema name can be used in a procedure call * statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support schema-qualified * procedure identifiers; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSchemasInProcedureCalls() throws SQLException { return false; } /** * Retrieves whether a schema name can be used in a table * definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support schema-qualified * table definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSchemasInTableDefinitions() throws SQLException { return false; } /** * Retrieves whether a schema name can be used in an index * definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support schema-qualified * index definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSchemasInIndexDefinitions() throws SQLException { return false; } /** * Retrieves whether a schema name can be used in a privilege * definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support schema-qualified * privilege definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException { return false; } /** * Retrieves whether a catalog name can be used in a data * manipulation statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalog-qualified; * data manipulation; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCatalogsInDataManipulation() throws SQLException { return false; } /** * Retrieves whether a catalog name can be used in a * procedure call statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalog-qualified * procedure calls; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCatalogsInProcedureCalls() throws SQLException { return false; } /** * Retrieves whether a catalog name can be used in a * table definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalog-qualified * table definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCatalogsInTableDefinitions() throws SQLException { return false; } /** * Retrieves whether a catalog name can be used in an * index definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalog-qualified * index definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCatalogsInIndexDefinitions() throws SQLException { return false; } /** * Retrieves whether a catalog name can be used in a * privilege definition statement.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalog-qualified * privilege definitions; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException { return false; } /** * Retrieves whether this database supports positioned DELETE * statements.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support updateable * result sets; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsPositionedDelete() throws SQLException { return false; } /** * Retrieves whether this database supports positioned UPDATE * statements.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support updateable * result sets; this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsPositionedUpdate() throws SQLException { return false; } /** * Retrieves whether this database supports SELECT FOR UPDATE * statements.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support explicit locking; * this method always returns false. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSelectForUpdate() throws SQLException { return false; } /** * Retrieves whether this database supports stored procedure calls * that use the stored procedure escape syntax.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB supports calling public static * Java methods in the context of SQL Stored Procedures; this method * always returns true. *

* * @return true if so; false otherwise * @exception SQLException if a database access error occurs * @see jdbcPreparedStatement * @see jdbcConnection#prepareCall */ public boolean supportsStoredProcedures() throws SQLException { return true; } /** * Retrieves whether this database supports subqueries in comparison * expressions.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB has always supported subqueries in comparison expressions; * this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSubqueriesInComparisons() throws SQLException { return true; } /** * Retrieves whether this database supports subqueries in * EXISTS expressions.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB has always supported subqueries in EXISTS * expressions; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSubqueriesInExists() throws SQLException { return true; } /** * Retrieves whether this database supports subqueries in * IN statements.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB has always supported subqueries in IN * statements; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSubqueriesInIns() throws SQLException { return true; } /** * Retrieves whether this database supports subqueries in quantified * expressions.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB has always supported subqueries in quantified * expressions; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsSubqueriesInQuantifieds() throws SQLException { return true; } /** * Retrieves whether this database supports correlated subqueries.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB has always supported correlated subqueries; * this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsCorrelatedSubqueries() throws SQLException { return true; } /** * Retrieves whether this database supports SQL UNION.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports SQL UNION; * this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsUnion() throws SQLException { return true; } /** * Retrieves whether this database supports SQL UNION ALL.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports SQL UNION ALL; * this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsUnionAll() throws SQLException { return true; } /** * Retrieves whether this database supports keeping cursors open * across commits.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support keeping * cursors open across commits; this method always returns * false. *

* * @return true if cursors always remain open; * false if they might not remain open * @exception SQLException if a database access error occurs */ public boolean supportsOpenCursorsAcrossCommit() throws SQLException { return false; } /** * Retrieves whether this database supports keeping cursors open * across rollbacks.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support keeping * cursors open across rollbacks; * this method always returns false. *

* * @return true if cursors always remain open; * false if they might not remain open * @exception SQLException if a database access error occurs */ public boolean supportsOpenCursorsAcrossRollback() throws SQLException { return false; } /** * Retrieves whether this database supports keeping statements open * across commits.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports keeping statements open * across commits; * this method always returns true. *

* * * * @return true if statements always remain open; * false if they might not remain open * @exception SQLException if a database access error occurs */ public boolean supportsOpenStatementsAcrossCommit() throws SQLException { return true; } /** * Retrieves whether this database supports keeping statements open * across rollbacks.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports keeping statements open * across commits; * this method always returns true. *

* * * * @return true if statements always remain open; * false if they might not remain open * @exception SQLException if a database access error occurs */ public boolean supportsOpenStatementsAcrossRollback() throws SQLException { return true; } //---------------------------------------------------------------------- // The following group of methods exposes various limitations // based on the target database with the current driver. // Unless otherwise specified, a result of zero means there is no // limit, or the limit is not known. /** * Retrieves the maximum number of hex characters this database allows in an * inline binary literal.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * * @return max the maximum length (in hex characters) for a binary literal; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxBinaryLiteralLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of characters this database allows * for a character literal.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed for a character literal; * a result of zero means that there is no limit or the limit is * not known * @exception SQLException if a database access error occurs */ public int getMaxCharLiteralLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of characters this database allows * for a column name.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed for a column name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnNameLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of columns this database allows in a * GROUP BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of columns allowed; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnsInGroupBy() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of columns this database allows in * an index.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of columns allowed; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnsInIndex() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of columns this database allows in an * ORDER BY clause.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of columns allowed; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnsInOrderBy() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of columns this database allows in a * SELECT list.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of columns allowed; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnsInSelect() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of columns this database allows in * a table.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of columns allowed; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxColumnsInTable() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of concurrent connections to this * database that are possible.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of active connections possible at one time; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxConnections() throws SQLException { // hard limit is (probably) Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of characters that this database allows in a * cursor name.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed in a cursor name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxCursorNameLength() throws SQLException { // N/A => 0 return 0; } /** * Retrieves the maximum number of bytes this database allows for an * index, including all of the parts of the index.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit; * this method always returns 0. *

* * * @return the maximum number of bytes allowed; this limit includes the * composite of all the constituent parts of the index; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxIndexLength() throws SQLException { // N/A => 0? This may change as cache implementation changes? return 0; } /** * Retrieves the maximum number of characters that this database allows in a * schema name.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.1, HSQLDB does not support schema names at all.

* * Starting with 1.7.2, there is a switchable option to support experimental, * limited use of schema names; in any case, no known limit is imposed, * so this method always returns 0. *

* * @return the maximum number of characters allowed in a schema name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxSchemaNameLength() throws SQLException { // N/A => 0 return 0; } /** * Retrieves the maximum number of characters that this database allows in a * procedure name.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed in a procedure name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxProcedureNameLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of characters that this database allows in a * catalog name.

* * *

*

HSQLDB-Specific Information:

* * Up to and including 1.7.2, HSQLDB does not support catalogs in * DDL or DML; this method always returns 0. *

* * * @return the maximum number of characters allowed in a catalog name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxCatalogNameLength() throws SQLException { // N/A => 0 return 0; } /** * Retrieves the maximum number of bytes this database allows in * a single row.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit; * this method always returns 0. *

* * * @return the maximum number of bytes allowed for a row; a result of * zero means that there is no limit or the limit is not known * @exception SQLException if a database access error occurs */ public int getMaxRowSize() throws SQLException { return 0; } /** * Retrieves whether the return value for the method * getMaxRowSize includes the SQL data types * LONGVARCHAR and LONGVARBINARY.

* * *

*

HSQLDB-Specific Indormation:

* * Including 1.7.2, {@link #getMaxRowSize} always returns * 0, indicating that the maximum row size is unknown or has no limit. * This applies to the above types as well; this method always * returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean doesMaxRowSizeIncludeBlobs() throws SQLException { return true; } /** * Retrieves the maximum number of characters this database allows in * an SQL statement.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed for an SQL statement; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxStatementLength() throws SQLException { return 0; } /** * Retrieves the maximum number of active statements to this database * that can be open at the same time.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit; * this method always returns 0. *

* * * @return the maximum number of statements that can be open at one time; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxStatements() throws SQLException { return 0; } /** * Retrieves the maximum number of characters this database allows in * a table name.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed for a table name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxTableNameLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } /** * Retrieves the maximum number of tables this database allows in a * SELECT statement.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a Java array (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of tables allowed in a SELECT * statement; a result of zero means that there is no limit or * the limit is not known * @exception SQLException if a database access error occurs */ public int getMaxTablesInSelect() throws SQLException { // - soft limit is >>> than will ever be seen in any real stmnt // - exists a fixed (non statement dependent) hard limit? No. // - depends totally on number of table idents that can fit in // Integer.MAX_VALUE characters, minus the rest of the stmnt return 0; } /** * Retrieves the maximum number of characters this database allows in * a user name.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not impose a "known" limit. The hard limit is the maximum * length of a java.lang.String (java.lang.Integer.MAX_VALUE); * this method always returns 0. *

* * * @return the maximum number of characters allowed for a user name; * a result of zero means that there is no limit or the limit * is not known * @exception SQLException if a database access error occurs */ public int getMaxUserNameLength() throws SQLException { // hard limit is Integer.MAX_VALUE return 0; } //---------------------------------------------------------------------- /** * Retrieves this database's default transaction isolation level. The * possible values are defined in java.sql.Connection.

* * *

*

HSQLDB-Specific Information

* * Including 1.7.2, HSQLDB supports only TRANSACTION_READ_COMMITED * and always returns this value here. *
* * * @return the default isolation level * @exception SQLException if a database access error occurs * @see jdbcConnection */ public int getDefaultTransactionIsolation() throws SQLException { return Connection.TRANSACTION_READ_UNCOMMITTED; } /** * Retrieves whether this database supports transactions. If not, invoking the * method commit is a noop, and the isolation level is * TRANSACTION_NONE.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports transactions; * this method always returns true. *

* * @return true if transactions are supported; * false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsTransactions() throws SQLException { return true; } /** * Retrieves whether this database supports the given transaction * isolation level.

* * *

*

HSQLDB-Specific Information

* HSQLDB supports only TRANSACTION_READ_UNCOMMITED. *
* * * * @param level one of the transaction isolation levels defined in * java.sql.Connection * @return true if so; false otherwise * @exception SQLException if a database access error occurs * @see jdbcConnection */ public boolean supportsTransactionIsolationLevel(int level) throws SQLException { return level == Connection.TRANSACTION_READ_UNCOMMITTED; } /** * Retrieves whether this database supports both data definition and * data manipulation statements within a transaction.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB does not support a mix of both data definition and * data manipulation statements within a transaction. DDL commits the * current transaction before proceding; * this method always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException { return false; } /** * Retrieves whether this database supports only data manipulation * statements within a transaction.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB supports only data manipulation * statements within a transaction. DDL commits the * current transaction before proceeding, while DML does not; * this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean supportsDataManipulationTransactionsOnly() throws SQLException { return true; } /** * Retrieves whether a data definition statement within a transaction forces * the transaction to commit.

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.2, a data definition statement within a transaction forces * the transaction to commit; this method always returns true. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean dataDefinitionCausesTransactionCommit() throws SQLException { return true; } /** * Retrieves whether this database ignores a data definition statement * within a transaction.

* * *

*

HSQLDB-Specific Information:

* * Including 1.7.2, a data definition statement is not ignored within a * transaction. Rather, a data definition statement within a * transaction forces the transaction to commit; this method * always returns false. *

* * * * @return true if so; false otherwise * @exception SQLException if a database access error occurs */ public boolean dataDefinitionIgnoredInTransactions() throws SQLException { return false; } /** * Retrieves a description of the stored procedures available in the given * catalog. *

* Only procedure descriptions matching the schema and * procedure name criteria are returned. They are ordered by * PROCEDURE_SCHEM and PROCEDURE_NAME. * *

Each procedure description has the the following columns: *

    *
  1. PROCEDURE_CAT String => procedure catalog (may be null) *
  2. PROCEDURE_SCHEM String => procedure schema (may be null) *
  3. PROCEDURE_NAME String => procedure name *
  4. reserved for future use *
  5. reserved for future use *
  6. reserved for future use *
  7. REMARKS String => explanatory comment on the procedure *
  8. PROCEDURE_TYPE short => kind of procedure: *
      *
    • procedureResultUnknown - May return a result *
    • procedureNoResult - Does not return a result *
    • procedureReturnsResult - Returns a result *
    *

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive in SQL but stores * them in upper case; it treats quoted identifiers as case sensitive and * stores them verbatim. All jdbcDatabaseMetaData methods perform * case-sensitive comparison between name (pattern) arguments and the * corresponding identifier values as they are stored in the database. * Therefore, care must be taken to specify name arguments precisely * (including case) as they are stored in the database.

* * Including 1.7.1, HSQLDB produces an empty result, despite * the fact that stored procedures are available. Also, the three * "reserved for future use" columns in the result are labeled * NUM_INPUT_PARAMS, NUM_OUTPUT_PARAMS, NUM_RESULT_SETS in anticipation * of future improvements (scheduled for 1.7.2). * * Since 1.7.2, there is an option to support this feature to greater or * lesser degrees. See the documentation specific to the selected system * table provider implementation. The default implementation is * {@link org.hsqldb.DatabaseInformationFull}. *

* * * @param catalog a catalog name; must match the catalog name as it * is stored in the database; "" retrieves those without a catalog; * null means that the catalog name should not be used * to narrow the search * @param schemaPattern a schema name pattern; must match the schema name * as it is stored in the database; "" retrieves those without a * schema; null means that the schema name should not be * used to narrow the search * @param procedureNamePattern a procedure name pattern; must match the * procedure name as it is stored in the database * @return ResultSet - each row is a procedure description * @exception SQLException if a database access error occurs * @see #getSearchStringEscape */ public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException { if (wantsIsNull(procedureNamePattern)) { return executeSelect("SYSTEM_PROCEDURES", "0=1"); } StringBuffer select = toQueryPrefix("SYSTEM_PROCEDURES").append( and("PROCEDURE_CAT", "=", catalog)).append( and("PROCEDURE_SCHEM", "LIKE", schemaPattern)).append( and("PROCEDURE_NAME", "LIKE", procedureNamePattern)); // By default, query already returns the result ordered by // PROCEDURE_SCHEM, PROCEDURE_NAME... return execute(select.toString()); } /** * Retrieves a description of the given catalog's stored procedure parameter * and result columns. * *

Only descriptions matching the schema, procedure and * parameter name criteria are returned. They are ordered by * PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value, * if any, is first. Next are the parameter descriptions in call * order. The column descriptions follow in column number order. * *

Each row in the ResultSet is a parameter description or * column description with the following fields: *

    *
  1. PROCEDURE_CAT String => procedure catalog (may be null) *
  2. PROCEDURE_SCHEM String => procedure schema (may be null) *
  3. PROCEDURE_NAME String => procedure name *
  4. COLUMN_NAME String => column/parameter name *
  5. COLUMN_TYPE Short => kind of column/parameter: *
      *
    • procedureColumnUnknown - nobody knows *
    • procedureColumnIn - IN parameter *
    • procedureColumnInOut - INOUT parameter *
    • procedureColumnOut - OUT parameter *
    • procedureColumnReturn - procedure return value *
    • procedureColumnResult - result column in ResultSet *
    *
  6. DATA_TYPE short => SQL type from java.sql.Types *
  7. TYPE_NAME String => SQL type name, for a UDT type the * type name is fully qualified *
  8. PRECISION int => precision *
  9. LENGTH int => length in bytes of data *
  10. SCALE short => scale *
  11. RADIX short => radix *
  12. NULLABLE short => can it contain NULL. *
      *
    • procedureNoNulls - does not allow NULL values *
    • procedureNullable - allows NULL values *
    • procedureNullableUnknown - nullability unknown *
    *
  13. REMARKS String => comment describing parameter/column *
* *

Note: Some databases may not return the column * descriptions for a procedure. Additional columns beyond * REMARKS can be defined by the database.

* * *

*

HSQLDB-Specific Information:

* * HSQLDB treats unquoted identifiers as case insensitive in SQL but stores * them in upper case; it treats quoted identifiers as case sensitive and * stores them verbatim. All jdbcDatabaseMetaData methods perform * case-sensitive comparison between name (pattern) arguments and the * corresponding identifier values as they are stored in the database. * Therefore, care must be taken to specify name arguments precisely * (including case) as they are stored in the database.

* * Including 1.7.1, HSQLDB produces an empty result, despite * the fact that stored procedures are available.

* * Since 1.7.2, there is an option to support this feature to greater or * lesser degrees. See the documentation specific to the selected system * table provider implementation. The default implementation is * {@link org.hsqldb.DatabaseInformationFull}. *

* * * @param catalog a catalog name; must match the catalog name as it * is stored in the database; "" retrieves those without a catalog; * null means that the catalog name should not be used * to narrow the search * @param schemaPattern a schema name pattern; must match the schema name * as it is stored in the database; "" retrieves those without a * schema; null means that the schema name should not be * used to narrow the search * @param procedureNamePattern a procedure name pattern; must match the * procedure name as it is stored in the database * @param columnNamePattern a column name pattern; must match the column * name as it is stored in the database * @return ResultSet - each row describes a stored procedure * parameter or column * @exception SQLException if a database access error occurs * @see #getSearchStringEscape */ public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException { if (wantsIsNull(procedureNamePattern) || wantsIsNull(columnNamePattern)) { return executeSelect("SYSTEM_PROCEDURECOLUMNS", "0=1"); } StringBuffer select = toQueryPrefix("SYSTEM_PROCEDURECOLUMNS").append( and("PROCEDURE_CAT", "=", catalog)).append( and("PROCEDURE_SCHEM", "LIKE", schemaPattern)).append( and("PROCEDURE_NAME", "LIKE", procedureNamePattern)).append( and("COLUMN_NAME", "LIKE", columnNamePattern)); // By default, query already returns result ordered by // PROCEDURE_SCHEM and PROCEDURE_NAME... return execute(select.toString()); } /** * Retrieves a description of the tables available in the given catalog. * Only table descriptions matching the catalog, schema, table * name and type criteria are returned. They are ordered by * TABLE_TYPE, TABLE_SCHEM and TABLE_NAME. *

* Each table description has the following columns: *

    *
  1. TABLE_CAT String => table catalog (may be null) *
  2. TABLE_SCHEM String => table schema (may be null) *
  3. TABLE_NAME String => table name *
  4. TABLE_TYPE String => table type. Typical types are "TABLE", * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", * "LOCA