Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * $Id: AbstractDatabaseMetaData.java 58991 2014-01-02 16:57:04Z mrotteveel $
    * 
    * Firebird Open Source J2ee connector - jdbc driver
    *
    * Distributable under LGPL license.
    * You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
    *
    * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * LGPL License for more details.
   *
   * This file was created by members of the firebird development team.
   * All individual contributions remain the Copyright (C) of those
   * individuals.  Contributors to this file are either listed here or
   * can be obtained from a CVS history command.
   *
   * All rights reserved.
   */
  package org.firebirdsql.jdbc;
  
  import java.sql.*;
  import java.util.*;
  
Comprehensive information about the database as a whole.

Many of the methods here return lists of information in the form of ResultSet objects. You can use the normal ResultSet methods such as getString and getInt to retrieve the data from these ResultSet. If a given form of metadata is not available, these methods should throw an SQLException.

Some of these 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 a null ref, that argument's criteria will be dropped from the search.

An SQLException will be thrown if a driver does not support a meta data method. In the case of methods that return a ResultSet, either a ResultSet (which may be empty) is returned or a SQLException is thrown.

Author(s):
David Jencks
Mark Rotteveel
  
  public abstract class AbstractDatabaseMetaData implements FirebirdDatabaseMetaData {
  
      private final static Logger log = LoggerFactory.getLogger(FBDatabaseMetaData.class,false);
      private static final String SPACES_31 = "                               "// 31 spaces
      private static final String SPACES_15 = "               "// 15 spaces
  
      private GDSHelper gdsHelper;
      private AbstractConnection connection;
  
      HashMap statements = new HashMap();
  
      protected AbstractDatabaseMetaData(GDSHelper gdsHelper) {
          this. = gdsHelper;
      }
      
      protected AbstractDatabaseMetaData(AbstractConnection cthrows GDSException {
          this. = c.getGDSHelper();
          this. = c;
      }
  
      protected void close() {
          try {
              Iterator i = .values().iterator();
              while(i.hasNext()) {
                  AbstractStatement stmt = (AbstractPreparedStatement)i.next();
                  if (!stmt.isClosed())
                      stmt.close();
              }
              .clear();
          }
          catch (SQLException e) {
             if (!=null.warn("error in DatabaseMetaData.close"e);
          }
      }
  
      //----------------------------------------------------------------------
      // First, a variety of minor information about the target database.
  
    
Can all the procedures returned by getProcedures be called by the current user?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean allProceduresAreCallable() throws SQLException {
         //returns all procedures whether or not you have execute permission
         return false;
     }


    
Can all the tables returned by getTable be SELECTed by the current user?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean allTablesAreSelectable() throws SQLException {
         //returns all tables matching criteria independent of access permissions.
         return false;
     }


    
What's the url for this database?

Returns:
the url or null if it cannot be generated
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getURL() throws SQLException {
         AbstractGDS gds = ((AbstractGDS.getInternalAPIHandler());
         
         return GDSFactory.getJdbcUrl(gds.getType(), ..getDatabase());
     }


    
What's our user name as known to the database?

Returns:
our database user name
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getUserName() throws SQLException {
         return .getUserName();
     }


    
Is the database in read-only mode?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean isReadOnly() throws SQLException {
         return false;//could be true, not yetimplemented
     }


    
Are NULL values sorted high?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean nullsAreSortedHigh() throws SQLException {
         // in Firebird 1.5.x NULLs are always sorted at the end
         // in Firebird 2.0.x NULLs are sorted low
         return false;
     }


    
Are NULL values sorted low?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean nullsAreSortedLow() throws SQLException {
         // in Firebird 1.5.x NULLs are always sorted at the end
         // in Firebird 2.0.x NULLs are sorted low
         return .compareToVersion(2, 0) >= 0;
     }


    
Are NULL values sorted at the start regardless of sort order?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean nullsAreSortedAtStart() throws SQLException {
         // in Firebird 1.5.x NULLs are always sorted at the end
         // in Firebird 2.0.x NULLs are sorted low
         return false;
     }


    
Are NULL values sorted at the end regardless of sort order?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean nullsAreSortedAtEnd() throws SQLException {
         // in Firebird 1.5.x NULLs are always sorted at the end
         // in Firebird 2.0.x NULLs are sorted low
         return .compareToVersion(2, 0) < 0;
     }


    
What's the name of this database product?

Returns:
database product name
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getDatabaseProductName() throws SQLException {
         return .getDatabaseProductName();
     }


    
What's the version of this database product?

Returns:
database version
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getDatabaseProductVersion() throws SQLException {
         return .getDatabaseProductVersion();
     }


    
What's the name of this JDBC driver?

Returns:
JDBC driver name
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getDriverName() throws SQLException {
         return "Jaybird JCA/JDBC driver";
     }


    
What's the version of this JDBC driver?

Returns:
JDBC driver version
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getDriverVersion() throws SQLException {
         return "2.2";
     }


    
What's this JDBC driver's major version number?

Returns:
JDBC driver major version
 
     public  int getDriverMajorVersion() {
         return 2;
     }


    
What's this JDBC driver's minor version number?

Returns:
JDBC driver minor version number
 
     public  int getDriverMinorVersion() {
         return 2;
     }


    
Does the database store tables in a local file?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean usesLocalFiles() throws SQLException {
         return false;
     }


    
Does the database use a file for each table?

Returns:
true if the database uses a local file for each table
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean usesLocalFilePerTable() throws SQLException {
         return false;
     }


    
Does the database treat mixed case unquoted SQL identifiers as case sensitive and as a result store them in mixed case? A JDBC CompliantTM driver will always return false.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsMixedCaseIdentifiers() throws SQLException {
         return false;
     }

    

Returns:
a boolean value
Throws:
java.sql.SQLException if an error occurs TODO implement statement pooling on the server.. then in the driver
 
     public boolean supportsStatementPooling() throws SQLException {
         return false;
     }
 
     public boolean locatorsUpdateCopy() throws SQLException {
         // Firebird creates a new blob when making changes
         return true;
     }

    
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them in upper case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesUpperCaseIdentifiers() throws SQLException {
         return true;
     }


    
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them in lower case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesLowerCaseIdentifiers() throws SQLException {
         return false;
     }


    
Does the database treat mixed case unquoted SQL identifiers as case insensitive and store them in mixed case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesMixedCaseIdentifiers() throws SQLException {
         return false;
     }


    
Does the database treat mixed case quoted SQL identifiers as case sensitive and as a result store them in mixed case? A JDBC CompliantTM driver will always return true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
         return true;
     }


    
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them in upper case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
         return false;
     }


    
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them in lower case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
         return false;
     }


    
Does the database treat mixed case quoted SQL identifiers as case insensitive and store them in mixed case?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
         return false;
     }


    
What's the string used to quote SQL identifiers? This returns a space " " if identifier quoting isn't supported. A JDBC CompliantTM driver always uses a double quote character.

Returns:
the quoting string
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getIdentifierQuoteString() throws SQLException {
         return "\"";
     }

    
Describe constant fbSQLKeywords here. Derived from firebird2/src/dsql/keywords.cpp. Exclusions from list of sql-92 keywords in SQL Instant Reference, Martin Gruber (1993) Sybex.
 
     private final static String fbSQLKeywords =
     //"ACTION," +
     "ACTIVE," +
     //"ADD," +
     "ADMIN," +
     "AFTER," +
     //"ALL," +
     //"ALTER," + 
     //"AND," + 
     //"ANY," + 
     //"AS," + 
     //"ASC," +    /* Alias of ASCENDING */
     "ASCENDING," +
     //"AT," +
     "AUTO," +
     //"AVG," +
     "BASE_NAME," +
     "BEFORE," +
     //"BEGIN," +
     //"BETWEEN," +
     "BIGINT," +
     "BLOB," +
     "BREAK," + 
     //"BY," +
     "CACHE," +
     //"CASCADE," +
     //"CASE," +
     //"CAST," +
     //"CHAR," +
     //"CHARACTER," +
     //"CHECK," +
     "CHECK_POINT_LENGTH," +
     //"COALESCE," +
     //"COLLATE," +
     //"COLUMN," +
     //"COMMIT," +
     //"COMMITTED," +
     "COMPUTED," +
     "CONDITIONAL," +
     "CONNECTION_ID," +
     //"CONSTRAINT," +
     "CONTAINING," +
     //"COUNT," +
     //"CREATE," +
     "CSTRING," +
     //"CURRENT," +
     //"CURRENT_DATE," +
     "CURRENT_ROLE," +
     //"CURRENT_TIME," +
     //"CURRENT_TIMESTAMP," +
     //"CURRENT_USER," +
     //"CURSOR," +
     "DATABASE," +
     //"DATE," +
     //"DAY," +
     "DEBUG," +
     //"DEC," +
     //"DECIMAL," +
     //"DECLARE," +
     //"DEFAULT," + 
     //"DELETE," + 
     //"DESC," +    /* Alias of DESCENDING */
     "DESCENDING," +
     //"DESCRIPTOR," +
     //"DISTINCT," +
     "DO," +
     //"DOMAIN," +
     //"DOUBLE," +
     //"DROP," +
     //"ELSE," +
     //"END," +
     "ENTRY_POINT," +
     //"ESCAPE," +
     //"EXCEPTION," +
     //"EXECUTE," +
     //"EXISTS," +
     "EXIT," +
     //"EXTERNAL," +
     //"EXTRACT," +
     "FILE," +
     "FILTER," +
     //"FIRST," +
     //"FLOAT," +
     //"FOR," +
     //"FOREIGN," +
     "FREE_IT," +
     //"FROM," +
     //"FULL," +
     "FUNCTION," +
     "GDSCODE," +
     "GENERATOR," +
     "GEN_ID," +
     //"GRANT," +
     //"GROUP," +
     "GROUP_COMMIT_WAIT_TIME," +
     //"HAVING," +
     //"HOUR," +
     "IF," +
     //"IN," +
     "INACTIVE," +
     "INDEX," +
     //"INNER," +
     "INPUT_TYPE," +
     //"INSERT," +
     //"INT," +
     //"INTEGER," +
     //"INTO," +
     //"IS," +
     //"ISOLATION," +
     //"JOIN," +
     //"KEY," +
     //"LAST," +
     //"LEFT," +
     //"LENGTH," +
     //"LEVEL," +
     //"LIKE," +
     "LOGFILE," +
     "LOG_BUFFER_SIZE," +
     "LONG," +
     "MANUAL," +
     //"MAX," +
     "MAXIMUM_SEGMENT," +
     "MERGE," +
     "MESSAGE," +
     //"MIN," +
     //"MINUTE," +
     "MODULE_NAME," +
     //"MONTH," +
     //"NAMES," +
     //"NATIONAL," +
     //"NATURAL," +
     //"NCHAR," +
     //"NO," +
     //"NOT," +
     //"NULLIF," +
     //"NULL," +
     "NULLS," +
     "LOCK," +
     //"NUMERIC," +
     "NUM_LOG_BUFFERS," +
     //"OF," +
     //"ON," +
     //"ONLY," +
     //"OPTION," +
     //"OR," +
     //"ORDER," +
     //"OUTER," +
     "OUTPUT_TYPE," +
     "OVERFLOW," +
     "PAGE," +
     "PAGES," +
     "PAGE_SIZE," +
     "PARAMETER," +
     "PASSWORD," +
     "PLAN," +
     //"POSITION," +
     "POST_EVENT," +
     //"PRECISION," +
     //"PRIMARY," +
     //"PRIVILEGES," +
     //"PROCEDURE," +
     "PROTECTED," +
     "RAW_PARTITIONS," +
     "RDB$DB_KEY," +
     //"READ," +
     //"REAL," +
     "RECORD_VERSION," +
     "RECREATE," +
     //"REFERENCES," + 
     "RESERV," +    /* Alias of RESERVING */
     "RESERVING," +
     //"RESTRICT," +
     "RETAIN," +
     "RETURNING_VALUES," +
     "RETURNS," +
     //"REVOKE," +
     //"RIGHT," +
     "ROLE," + 
     //"ROLLBACK," + 
     "ROWS_AFFECTED," +
     "SAVEPOINT," +
     //"SCHEMA," +    /* Alias of DATABASE */
     //"SECOND," +
     "SEGMENT," +
     //"SELECT," +
     //"SET," +
     "SHADOW," +
     "SHARED," +
     "SINGULAR," +
     //"SIZE," +
     "SKIP," +
     //"SMALLINT," +
     "SNAPSHOT," +
     //"SOME," +
     "SORT," +
     //"SQLCODE," +
     "STABILITY," + 
     "STARTING," + 
     "STARTS," +    /* Alias of STARTING */
     "STATISTICS," +
     //"SUBSTRING," +
     "SUB_TYPE," +
     //"SUM," +
     "SUSPEND," +
     //"TABLE," +
     //"THEN," +
     //"TIME," +
     //"TIMESTAMP," +
     //"TO," +
     //"TRANSACTION," +
     "TRANSACTION_ID," +
     "TRIGGER," +
     //"TYPE," +
     //"UNCOMMITTED," +
     //"UNION," +
     //"UNIQUE," +
     //"UPDATE," +
     //"UPPER," +
     //"USER," +
     //"USING," +
     //"VALUE," +
     //"VALUES," +
     //"VARCHAR," +
     "VARIABLE," +
     //"VARYING," +
     //"VIEW," +
     "WAIT," +
     "WEEKDAY," +
     //"WHEN," +
     //"WHERE," +
     "WHILE," +
     //"WITH," +
     //"WORK," +
     //"WRITE," + 
     //"YEAR," + 
     "YEARDAY"


    
Gets a comma-separated list of all a database's SQL keywords that are NOT also SQL92 keywords.

Returns:
the list
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getSQLKeywords() throws SQLException {
         return ;
     }


    
Gets a comma-separated list of math functions. These are the X/Open CLI math function names used in the JDBC function escape clause.

Returns:
the list
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getNumericFunctions() throws SQLException {
         return "";//udf's
     }


    
Gets a comma-separated list of string functions. These are the X/Open CLI string function names used in the JDBC function escape clause.

Returns:
the list
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getStringFunctions() throws SQLException {
         return "SUBSTRING,UCASE,CONCAT";
     }


    
Gets a comma-separated list of system functions. These are the X/Open CLI system function names used in the JDBC function escape clause.

Returns:
the list
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getSystemFunctions() throws SQLException {
         return "";
     }


    
Gets a comma-separated list of time and date functions.

Returns:
the list
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getTimeDateFunctions() throws SQLException {
         return "CURDATE,CURTIME,DAYOFYEAR,HOUR,MINUTE,MONTH,NOW,SECOND,YEAR";
     }


    
Gets the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or '%' in the string pattern style catalog search parameters.

The '_' character represents any single character.

The '%' character represents any sequence of zero or more characters.

Returns:
the string used to escape wildcard characters
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getSearchStringEscape() throws SQLException {
         return "\\";
     }


    
Gets all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).

Returns:
the string containing the extra characters
Throws:
java.sql.SQLException if a database access error occurs
 
     public  String getExtraNameCharacters() throws SQLException {
         return "$";
     }
 
 
     //--------------------------------------------------------------------
     // Functions describing which features are supported.
 
    
Is "ALTER TABLE" with add column supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsAlterTableWithAddColumn() throws SQLException {
         return true;
     }


    
Is "ALTER TABLE" with drop column supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsAlterTableWithDropColumn() throws SQLException {
         return true;
     }


    
Is column aliasing supported?

If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as required. A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsColumnAliasing() throws SQLException {
         return true;
     }


    
Retrieves whether concatenations between NULL and non-NULL values equal NULL. For SQL-92 compliance, a JDBC technology-enabled driver will return true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean nullPlusNonNullIsNull() throws SQLException {
         return true;
     }


    
Is the CONVERT function between SQL types supported? What is this??? my sql ref says CONVERT is a string encoding map!

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsConvert() throws SQLException {
         return false;//don't know
     }


    
Retrieves whether CONVERT between the given SQL types supported.

Parameters:
fromType the type to convert from
toType the type to convert to
Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
See also:
java.sql.Types
 
     public  boolean supportsConvert(int fromTypeint toTypethrows SQLException {
         return false;//don't know
     }


    
Are table correlation names supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsTableCorrelationNames() throws SQLException {
         return true;
     }


    
If table correlation names are supported, are they restricted to be different from the names of the tables?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsDifferentTableCorrelationNames() throws SQLException {
         return false//I think
     }


    
Are expressions in "ORDER BY" lists supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsExpressionsInOrderBy() throws SQLException {
         return false//coming soon
     }


    
Can an "ORDER BY" clause use columns not in the SELECT statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsOrderByUnrelated() throws SQLException {
         return true;
     }


    
Is some form of "GROUP BY" clause supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsGroupBy() throws SQLException {
         return true;
     }


    
Can a "GROUP BY" clause use columns not in the SELECT?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsGroupByUnrelated() throws SQLException {
         return false;
     }


    
Can a "GROUP BY" clause add columns not in the SELECT provided it specifies all the columns in the SELECT?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsGroupByBeyondSelect() throws SQLException {
         return false;
     }


    
Is the escape character in "LIKE" clauses supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsLikeEscapeClause() throws SQLException {
         return true;
     }


    
Are multiple ResultSet from a single execute supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsMultipleResultSets() throws SQLException {
         return false;
     }


    
Can we have multiple transactions open at once (on different connections)?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsMultipleTransactions() throws SQLException {
         return true;
     }


    
Can columns be defined as non-nullable? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsNonNullableColumns() throws SQLException {
         return true;
     }


    
Is the ODBC Minimum SQL grammar supported? All JDBC CompliantTM drivers must return true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsMinimumSQLGrammar() throws SQLException {
         return true//lets see what the tests say
     }


    
Is the ODBC Core SQL grammar supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
     public  boolean supportsCoreSQLGrammar() throws SQLException {
         return true//lets see what the tests say
     }


    
Is the ODBC Extended SQL grammar supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
 
    public  boolean supportsExtendedSQLGrammar() throws SQLException {
        return true//lets see what the tests say
    }


    
Is the ANSI92 entry level SQL grammar supported? All JDBC CompliantTM drivers must return true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsANSI92EntryLevelSQL() throws SQLException {
        return true//lets see what the tests say
    }


    
Is the ANSI92 intermediate SQL grammar supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsANSI92IntermediateSQL() throws SQLException {
        return false//lets see what the tests say
    }


    
Is the ANSI92 full SQL grammar supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsANSI92FullSQL() throws SQLException {
        return false//Nah, but lets see what the tests say
    }


    
Is the SQL Integrity Enhancement Facility supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsIntegrityEnhancementFacility() throws SQLException {
        return true// rrokytskyy: yep, they call so foreign keys + cascade deletes
    }

    
Is some form of outer join supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsOuterJoins() throws SQLException {
        return true;
    }

    
Are full nested outer joins supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsFullOuterJoins() throws SQLException {
        return true;
    }

    
Is there limited support for outer joins? (This will be true if supportFullOuterJoins is true.)

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsLimitedOuterJoins() throws SQLException {
        return true;
    }

    
What's the database vendor's preferred term for "schema"?

Returns:
the vendor term, always null because schemas are not supported by database server (see JDBC CTS for details).
Throws:
java.sql.SQLException if a database access error occurs
    public  String getSchemaTerm() throws  SQLException {
        return null;
    }


    
What's the database vendor's preferred term for "procedure"?

Returns:
the vendor term
Throws:
java.sql.SQLException if a database access error occurs
    public  String getProcedureTerm() throws SQLException {
        return "PROCEDURE";
    }


    
What's the database vendor's preferred term for "catalog"?

Returns:
the vendor term, always null because catalogs are not supported by database server (see JDBC CTS for details).
Throws:
java.sql.SQLException if a database access error occurs
    public  String getCatalogTerm() throws  SQLException {
        return null;
    }


    
Does a catalog appear at the start of a qualified table name? (Otherwise it appears at the end)

Returns:
true if it appears at the start
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean isCatalogAtStart() throws SQLException {
        return false;
    }


    
What's the separator between catalog and table name?

Returns:
the separator string, always null because catalogs are not supported by database server (see JDBC CTS for details).
Throws:
java.sql.SQLException if a database access error occurs
    public  String getCatalogSeparator() throws SQLException {
        return null;
    }


    
Can a schema name be used in a data manipulation statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSchemasInDataManipulation() throws SQLException {
        return false;
    }


    
Can a schema name be used in a procedure call statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSchemasInProcedureCalls() throws SQLException {
        return false;
    }


    
Can a schema name be used in a table definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSchemasInTableDefinitions() throws SQLException {
        return false;
    }


    
Can a schema name be used in an index definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSchemasInIndexDefinitions() throws SQLException {
        return false;
    }


    
Can a schema name be used in a privilege definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
        return false;
    }


    
Can a catalog name be used in a data manipulation statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCatalogsInDataManipulation() throws SQLException {
        return false;
    }


    
Can a catalog name be used in a procedure call statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCatalogsInProcedureCalls() throws SQLException {
        return false;
    }


    
Can a catalog name be used in a table definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCatalogsInTableDefinitions() throws SQLException {
        return false;
    }


    
Can a catalog name be used in an index definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCatalogsInIndexDefinitions() throws SQLException {
        return false;
    }


    
Can a catalog name be used in a privilege definition statement?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
        return false;
    }



    
Is positioned DELETE supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsPositionedDelete() throws SQLException {
        return true;
    }


    
Is positioned UPDATE supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsPositionedUpdate() throws SQLException {
        return true;
    }


    
Is SELECT for UPDATE supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSelectForUpdate() throws SQLException {
        return true;
    }


    
Are stored procedure calls using the stored procedure escape syntax supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsStoredProcedures() throws SQLException {
        return true;
    }

    
Are subqueries in comparison expressions supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSubqueriesInComparisons() throws SQLException {
        return true;
    }


    
Are subqueries in 'exists' expressions supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSubqueriesInExists() throws SQLException {
        return true;
    }


    
Are subqueries in 'in' statements supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSubqueriesInIns() throws SQLException {
        return true;
    }


    
Are subqueries in quantified expressions supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsSubqueriesInQuantifieds() throws SQLException {
        return true;
    }


    
Are correlated subqueries supported? A JDBC CompliantTM driver always returns true.

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsCorrelatedSubqueries() throws SQLException {
        return true;
    }


    
Is SQL UNION supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsUnion() throws SQLException {
        return true;
    }


    
Is SQL UNION ALL supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsUnionAll() throws SQLException {
        return true;
    }


    
Can cursors remain open across commits?

Returns:
true if cursors always remain open; false if they might not remain open
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsOpenCursorsAcrossCommit() throws SQLException {
        return false;//only when commit retaining is executed I think
    }


    
Can cursors remain open across rollbacks?

Returns:
true if cursors always remain open; false if they might not remain open
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsOpenCursorsAcrossRollback() throws SQLException {
        return false;//commit retaining only.
    }


    
Can statements remain open across commits?

Returns:
true if statements always remain open; false if they might not remain open
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsOpenStatementsAcrossCommit() throws SQLException {
        return true;//commit retaining only.
    }


    
Can statements remain open across rollbacks?

Returns:
true if statements always remain open; false if they might not remain open
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsOpenStatementsAcrossRollback() throws SQLException {
        return true;//commit retaining only.
    }
    //----------------------------------------------------------------------
    // 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.

    
How many hex characters can you have in an inline binary literal?

Returns:
max binary literal length in hex characters; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxBinaryLiteralLength() throws SQLException {
        return 0;//anyone know for sure?
    }

    
What's the max length for a character literal?

Returns:
max literal length; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxCharLiteralLength() throws SQLException {
        return 32767;
    }



    
What's the limit on column name length?

Returns:
max column name length; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnNameLength() throws SQLException {
        return 31;
    }

    
What's the maximum number of columns in a "GROUP BY" clause?

Returns:
max number of columns; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnsInGroupBy() throws SQLException {
        return 0; //I don't know
    }

    
What's the maximum number of columns allowed in an index?

Returns:
max number of columns; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnsInIndex() throws SQLException {
        return 0; //I don't know
    }

    
What's the maximum number of columns in an "ORDER BY" clause?

Returns:
max number of columns; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnsInOrderBy() throws SQLException {
        return 0; //I don't know
    }

    
What's the maximum number of columns in a "SELECT" list?

Returns:
max number of columns; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnsInSelect() throws SQLException {
        return 0; //I don't know
    }

    
What's the maximum number of columns in a table?

Returns:
max number of columns; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxColumnsInTable() throws SQLException {
        return 32767; // Depends on datatypes and sizes, at most 64 kbyte excluding blobs (but including blob ids)
    }

    
How many active connections can we have at a time to this database?

Returns:
max number of active connections; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxConnections() throws SQLException {
        return 0; //I don't know
    }

    
What's the maximum cursor name length?

Returns:
max cursor name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxCursorNameLength() throws SQLException {
        return 31;
    }

    
Retrieves the maximum number of bytes for an index, including all of the parts of the index.

Returns:
max index length in bytes, which 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
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxIndexLength() throws SQLException {
        if (.compareToVersion(2, 0) < 0) {
            return 252; // See http://www.firebirdsql.org/en/firebird-technical-specifications/
        } else {
            return 0; // 1/4 of page size, maybe retrieve page size and use that?
        }
    }

    
What's the maximum length allowed for a schema name?

Returns:
max name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxSchemaNameLength() throws SQLException {
        return 0; //No schemas
    }

    
What's the maximum length of a procedure name?

Returns:
max name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxProcedureNameLength() throws SQLException {
        return 31;
    }

    
What's the maximum length of a catalog name?

Returns:
max name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxCatalogNameLength() throws SQLException {
        return 0; //No catalogs
    }

    
What's the maximum length of a single row?

Returns:
max row size in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxRowSize() throws SQLException {
        if (.compareToVersion(1, 5) >= 0)
            return 65531;
        else 
            return 0;
    }

    
Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY blobs?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
        return false// Blob sizes are not included in rowsize 
    }

    
What's the maximum length of an SQL statement?

Returns:
max length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxStatementLength() throws SQLException {
        return 65536;
    }

    
How many active statements can we have open at one time to this database?

Returns:
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
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxStatements() throws SQLException {
        return 0;
    }

    
What's the maximum length of a table name?

Returns:
max name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxTableNameLength() throws SQLException {
        return 31;
    }

    
What's the maximum number of tables in a SELECT statement?

Returns:
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
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxTablesInSelect() throws SQLException {
        return 0;
    }

    
What's the maximum length of a user name?

Returns:
max user name length in bytes; a result of zero means that there is no limit or the limit is not known
Throws:
java.sql.SQLException if a database access error occurs
    public  int getMaxUserNameLength() throws SQLException {
        return 31;//I don't know??
    }
    //----------------------------------------------------------------------

    
What's the database's default transaction isolation level? The values are defined in java.sql.Connection.

Returns:
the default isolation level
Throws:
java.sql.SQLException if a database access error occurs
See also:
java.sql.Connection
    public  int getDefaultTransactionIsolation() throws SQLException {
        return .;//close enough to snapshot.
    }

    
Are transactions supported? If not, invoking the method commit is a noop and the isolation level is TRANSACTION_NONE.

Returns:
true if transactions are supported; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public  boolean supportsTransactions() throws SQLException {
        return true;
    }

    
Does this database support the given transaction isolation level?

Parameters:
level the values are defined in java.sql.Connection
Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
See also:
java.sql.Connection
    public boolean supportsTransactionIsolationLevel(int levelthrows SQLException {
        switch (level) {
            case .return false;
            case .return true;//true soon
            case .return false;
            case .return true;//??
            case .return true;//????
            defaultreturn false;
        }
    }

    
Are both data definition and data manipulation statements within a transaction supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
        return true;//but not on the tables you defined in the transaction!
    }

    
Are only data manipulation statements within a transaction supported?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
        return false;
    }

    
Does a data definition statement within a transaction force the transaction to commit?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
        return false;//but you can't use the table till the transaction is committed.
    }

    
Is a data definition statement within a transaction ignored?

Returns:
true if so; false otherwise
Throws:
java.sql.SQLException if a database access error occurs
    public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
        return false;
    }
    private static final String GET_PROCEDURES_START = "select "
        + "cast(RDB$PROCEDURE_NAME as varchar(31)) as PROCEDURE_NAME,"
        + "RDB$DESCRIPTION as REMARKS,"
        + "RDB$PROCEDURE_OUTPUTS as PROCEDURE_TYPE "
        + "from "
        + "RDB$PROCEDURES "
        + "where ";
    private static final String GET_PROCEDURES_END = "1 = 1 order by 1";

    
Gets a description of the stored procedures available in a 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
  9. SPECIFIC_NAME String => The name which uniquely identifies this procedure within its schema.

Parameters:
catalog a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
schemaPattern a schema name pattern; "" retrieves those without a schema
procedureNamePattern a procedure name pattern
Returns:
ResultSet - each row is a procedure description
Throws:
java.sql.SQLException if a database access error occurs
See also:
getSearchStringEscape()
    public ResultSet getProcedures(String catalogString schemaPattern,
            String procedureNamePatternthrows SQLException {
        checkCatalogAndSchema(catalogschemaPattern);
        
        if (procedureNamePattern == null || procedureNamePattern.equals("")) {
            procedureNamePattern = "%";
        }
        XSQLVAR[] xsqlvars = new XSQLVAR[9];
        xsqlvars[0] = new XSQLVAR();
        xsqlvars[0]. = .;
        xsqlvars[0]. = 31;
        xsqlvars[0]. = "PROCEDURE_CAT";
        xsqlvars[0]. = "RDB$PROCEDURES";
        xsqlvars[1] = new XSQLVAR();
        xsqlvars[1]. = .;
        xsqlvars[1]. = 31;
        xsqlvars[1]. = "PROCEDURE_SCHEM";
        xsqlvars[1]. = "RDB$PROCEDURES";
        xsqlvars[2] = new XSQLVAR();
        xsqlvars[2]. = .;
        xsqlvars[2]. = 31;
        xsqlvars[2]. = "PROCEDURE_NAME";
        xsqlvars[2]. = "RDB$PROCEDURES";
        xsqlvars[3] = new XSQLVAR();
        xsqlvars[3]. = .;
        xsqlvars[3]. = 31;
        xsqlvars[3]. = "FUTURE1";
        xsqlvars[3]. = "RDB$PROCEDURES";
        xsqlvars[4] = new XSQLVAR();
        xsqlvars[4]. = .;
        xsqlvars[4]. = 31;
        xsqlvars[4]. = "FUTURE2";
        xsqlvars[4]. = "RDB$PROCEDURES";
        xsqlvars[5] = new XSQLVAR();
        xsqlvars[5]. = .;
        xsqlvars[5]. = 31;
        xsqlvars[5]. = "FUTURE3";
        xsqlvars[5]. = "RDB$PROCEDURES";
        xsqlvars[6] = new XSQLVAR();
        xsqlvars[6]. = .;
        xsqlvars[6]. = 80; // gets updated if there are longer remarks.
        xsqlvars[6]. = "REMARKS";
        xsqlvars[6]. = "RDB$PROCEDURES";
        xsqlvars[7] = new XSQLVAR();
        xsqlvars[7]. = .;
        xsqlvars[7]. = "PROCEDURE_TYPE";
        xsqlvars[7]. = "RDB$PROCEDURES";
        
        xsqlvars[8] = new XSQLVAR();
        xsqlvars[8]. = .;
        xsqlvars[8]. = 31;
        xsqlvars[8]. = "SPECIFIC_NAME";
        xsqlvars[8]. = "RDB$PROCEDURES";
        Clause procedureClause = new Clause("RDB$PROCEDURE_NAME"procedureNamePattern);
        
        String sql = ;
        sql += procedureClause.getCondition();
        sql += ;
        
        // check the original case identifiers first
        ArrayList params = new ArrayList();
        if (!procedureClause.getCondition().equals("")) {
            params.add(procedureClause.getOriginalCaseValue());
        }
        ResultSet rs = doQuery(sqlparams);
        ArrayList rows = new ArrayList();
        
        // if nothing found, check the uppercased identifiers
        if (!rs.next()) {
            params.clear();
            if (!procedureClause.getCondition().equals("")) {
                params.add(procedureClause.getValue());
            }
            
            rs = doQuery(sqlparams);
            
            // if nothing found, return an empty result set
            if (!rs.next())
                return new FBResultSet(xsqlvarsrows);
        }
        
        do {
            byte[][] row = new byte[9][];
            row[0] = null;
            row[1] = null;
            row[2] = getBytes(rs.getString("PROCEDURE_NAME"));
            row[3] = null;
            row[4] = null;
            row[5] = null;
            String remarks = rs.getString("REMARKS");
            row[6] = getBytes(remarks);
            if (remarks != null && remarks.length() > xsqlvars[6].)
                xsqlvars[6]. = remarks.length();
            short procedureType = rs.getShort("PROCEDURE_TYPE");
            row[7] = (procedureType == 0) ? xsqlvars[0].encodeShort((short)) : xsqlvars[0].encodeShort((short));
            row[8] = row[2];
            rows.add(row);
        } while (rs.next());
        
        return new FBResultSet(xsqlvarsrows);
    }
    private static final String GET_PROCEDURE_COLUMNS_START = "select "
        + "cast(PP.RDB$PROCEDURE_NAME as varchar(31)) as PROCEDURE_NAME,"
        + "cast(PP.RDB$PARAMETER_NAME as varchar(31)) as COLUMN_NAME,"
        + "PP.RDB$PARAMETER_TYPE as COLUMN_TYPE,"
        + "F.RDB$FIELD_TYPE as FIELD_TYPE,"
        + "F.RDB$FIELD_SUB_TYPE as FIELD_SUB_TYPE,"
        + "F.RDB$FIELD_PRECISION as FIELD_PRECISION,"
        + "F.RDB$FIELD_SCALE as FIELD_SCALE,"
        + "F.RDB$FIELD_LENGTH as FIELD_LENGTH,"
        + "F.RDB$NULL_FLAG as NULL_FLAG,"
        + "PP.RDB$DESCRIPTION as REMARKS,"
        + "F.RDB$CHARACTER_LENGTH AS CHAR_LEN,"
        + "PP.RDB$PARAMETER_NUMBER + 1 AS PARAMETER_NUMBER "
        + "from "
        + "RDB$PROCEDURE_PARAMETERS PP,"
        + "RDB$FIELDS F "
        + "where ";
    private static final String GET_PROCEDURE_COLUMNS_END = " PP.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME "
        + "order by "
        + "PP.RDB$PROCEDURE_NAME,"
        + "PP.RDB$PARAMETER_TYPE desc,"
        + "PP.RDB$PARAMETER_NUMBER ";

    
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_CAT, PROCEDURE_SCHEM, PROCEDURE_NAME and SPECIFIC_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 int => 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 - null is returned for data types where SCALE is not applicable.
  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
  14. COLUMN_DEF String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null)
    • The string NULL (not enclosed in quotes) - if NULL was specified as the default value
    • TRUNCATE (not enclosed in quotes) - if the specified default value cannot be represented without truncation
    • NULL - if a default value was not specified
  15. SQL_DATA_TYPE int => reserved for future use
  16. SQL_DATETIME_SUB int => reserved for future use
  17. CHAR_OCTET_LENGTH int => the maximum length of binary and character based columns. For any other datatype the returned value is a NULL
  18. ORDINAL_POSITION int => the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0 is returned if this row describes the procedure's return value. For result set columns, it is the ordinal position of the column in the result set starting from 1. If there are multiple result sets, the column ordinal positions are implementation defined.
  19. IS_NULLABLE String => ISO rules are used to determine the nullability for a column.
    • YES --- if the parameter can include NULLs
    • NO --- if the parameter cannot include NULLs
    • empty string --- if the nullability for the parameter is unknown
  20. SPECIFIC_NAME String => the name which uniquely identifies this procedure within its schema.

Note: Some databases may not return the column descriptions for a procedure.

The PRECISION column represents the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable.

Parameters:
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
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
procedureNamePattern a procedure name pattern; must match the procedure name as it is stored in the database
columnNamePattern a column name pattern; must match the column name as it is stored in the database
Returns:
ResultSet - each row describes a stored procedure parameter or column
Throws:
java.sql.SQLException if a database access error occurs
See also:
getSearchStringEscape()
    public ResultSet getProcedureColumns(String catalog,
            String schemaPattern,
            String procedureNamePattern,
            String columnNamePatternthrows SQLException {
        checkCatalogAndSchema(catalogschemaPattern);
        XSQLVAR[] xsqlvars = new XSQLVAR[20];
        xsqlvars[0] = new XSQLVAR();
        xsqlvars[0]. = .;
        xsqlvars[0]. = 31;
        xsqlvars[0]. = "PROCEDURE_CAT";
        xsqlvars[0]. = "COLUMNINFO";
        xsqlvars[1] = new XSQLVAR();
        xsqlvars[1]. = .;
        xsqlvars[1]. = 31;
        xsqlvars[1]. = "PROCEDURE_SCHEM";
        xsqlvars[1]. = "COLUMNINFO";
        xsqlvars[2] = new XSQLVAR();
        xsqlvars[2]. = .;
        xsqlvars[2]. = 31;
        xsqlvars[2]. = "PROCEDURE_NAME";
        xsqlvars[2]. = "COLUMNINFO";
        xsqlvars[3] = new XSQLVAR();
        xsqlvars[3]. = .;
        xsqlvars[3]. = 31;
        xsqlvars[3]. = "COLUMN_NAME";
        xsqlvars[3]. = "COLUMNINFO";
        xsqlvars[4] = new XSQLVAR();
        xsqlvars[4]. = .;
        xsqlvars[4]. = "COLUMN_TYPE";
        xsqlvars[4]. = "COLUMNINFO";
        xsqlvars[5] = new XSQLVAR();