src/share/classes/java/sql/DatabaseMetaData.java

Print this page


   1 /*
   2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


1199 
1200     /**
1201      * Retrieves whether this database ignores a data definition statement
1202      * within a transaction.
1203      *
1204      * @return <code>true</code> if so; <code>false</code> otherwise
1205      * @exception SQLException if a database access error occurs
1206      */
1207     boolean dataDefinitionIgnoredInTransactions()
1208         throws SQLException;
1209 
1210     /**
1211      * Retrieves a description of the stored procedures available in the given
1212      * catalog.
1213      * <P>
1214      * Only procedure descriptions matching the schema and
1215      * procedure name criteria are returned.  They are ordered by
1216      * <code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code>,
1217      * <code>PROCEDURE_NAME</code> and <code>SPECIFIC_ NAME</code>.
1218      *
1219      * <P>Each procedure description has the the following columns:
1220      *  <OL>
1221      *  <LI><B>PROCEDURE_CAT</B> String {@code =>} procedure catalog (may be <code>null</code>)
1222      *  <LI><B>PROCEDURE_SCHEM</B> String {@code =>} procedure schema (may be <code>null</code>)
1223      *  <LI><B>PROCEDURE_NAME</B> String {@code =>} procedure name
1224      *  <LI> reserved for future use
1225      *  <LI> reserved for future use
1226      *  <LI> reserved for future use
1227      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the procedure
1228      *  <LI><B>PROCEDURE_TYPE</B> short {@code =>} kind of procedure:
1229      *      <UL>
1230      *      <LI> procedureResultUnknown - Cannot determine if  a return value
1231      *       will be returned
1232      *      <LI> procedureNoResult - Does not return a return value
1233      *      <LI> procedureReturnsResult - Returns a return value
1234      *      </UL>
1235      *  <LI><B>SPECIFIC_NAME</B> String  {@code =>} The name which uniquely identifies this
1236      * procedure within its schema.
1237      *  </OL>
1238      * <p>
1239      * A user may not have permissions to execute any of the procedures that are


1470      * returned by the method <code>getProcedureColumns</code>.
1471      */
1472     int procedureNullableUnknown = 2;
1473 
1474 
1475     /**
1476      * Retrieves a description of the tables available in the given catalog.
1477      * Only table descriptions matching the catalog, schema, table
1478      * name and type criteria are returned.  They are ordered by
1479      * <code>TABLE_TYPE</code>, <code>TABLE_CAT</code>,
1480      * <code>TABLE_SCHEM</code> and <code>TABLE_NAME</code>.
1481      * <P>
1482      * Each table description has the following columns:
1483      *  <OL>
1484      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1485      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1486      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1487      *  <LI><B>TABLE_TYPE</B> String {@code =>} table type.  Typical types are "TABLE",
1488      *                  "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
1489      *                  "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
1490      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the table
1491      *  <LI><B>TYPE_CAT</B> String {@code =>} the types catalog (may be <code>null</code>)
1492      *  <LI><B>TYPE_SCHEM</B> String {@code =>} the types schema (may be <code>null</code>)
1493      *  <LI><B>TYPE_NAME</B> String {@code =>} type name (may be <code>null</code>)
1494      *  <LI><B>SELF_REFERENCING_COL_NAME</B> String {@code =>} name of the designated
1495      *                  "identifier" column of a typed table (may be <code>null</code>)
1496      *  <LI><B>REF_GENERATION</B> String {@code =>} specifies how values in
1497      *                  SELF_REFERENCING_COL_NAME are created. Values are
1498      *                  "SYSTEM", "USER", "DERIVED". (may be <code>null</code>)
1499      *  </OL>
1500      *
1501      * <P><B>Note:</B> Some databases may not return information for
1502      * all tables.
1503      *
1504      * @param catalog a catalog name; must match the catalog name as it
1505      *        is stored in the database; "" retrieves those without a catalog;
1506      *        <code>null</code> means that the catalog name should not be used to narrow
1507      *        the search
1508      * @param schemaPattern a schema name pattern; must match the schema name
1509      *        as it is stored in the database; "" retrieves those without a schema;
1510      *        <code>null</code> means that the schema name should not be used to narrow


1693      * in the <code>ResultSet</code> returned by the method
1694      * <code>getColumns</code>.
1695      */
1696     int columnNullableUnknown = 2;
1697 
1698     /**
1699      * Retrieves a description of the access rights for a table's columns.
1700      *
1701      * <P>Only privileges matching the column name criteria are
1702      * returned.  They are ordered by COLUMN_NAME and PRIVILEGE.
1703      *
1704      * <P>Each privilege description has the following columns:
1705      *  <OL>
1706      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1707      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1708      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1709      *  <LI><B>COLUMN_NAME</B> String {@code =>} column name
1710      *  <LI><B>GRANTOR</B> String {@code =>} grantor of access (may be <code>null</code>)
1711      *  <LI><B>GRANTEE</B> String {@code =>} grantee of access
1712      *  <LI><B>PRIVILEGE</B> String {@code =>} name of access (SELECT,
1713      *      INSERT, UPDATE, REFRENCES, ...)
1714      *  <LI><B>IS_GRANTABLE</B> String {@code =>} "YES" if grantee is permitted
1715      *      to grant to others; "NO" if not; <code>null</code> if unknown
1716      *  </OL>
1717      *
1718      * @param catalog a catalog name; must match the catalog name as it
1719      *        is stored in the database; "" retrieves those without a catalog;
1720      *        <code>null</code> means that the catalog name should not be used to narrow
1721      *        the search
1722      * @param schema a schema name; must match the schema name as it is
1723      *        stored in the database; "" retrieves those without a schema;
1724      *        <code>null</code> means that the schema name should not be used to narrow
1725      *        the search
1726      * @param table a table name; must match the table name as it is
1727      *        stored in the database
1728      * @param columnNamePattern a column name pattern; must match the column
1729      *        name as it is stored in the database
1730      * @return <code>ResultSet</code> - each row is a column privilege description
1731      * @exception SQLException if a database access error occurs
1732      * @see #getSearchStringEscape
1733      */


1738      * Retrieves a description of the access rights for each table available
1739      * in a catalog. Note that a table privilege applies to one or
1740      * more columns in the table. It would be wrong to assume that
1741      * this privilege applies to all columns (this may be true for
1742      * some systems but is not true for all.)
1743      *
1744      * <P>Only privileges matching the schema and table name
1745      * criteria are returned.  They are ordered by
1746      * <code>TABLE_CAT</code>,
1747      * <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code>,
1748      * and <code>PRIVILEGE</code>.
1749      *
1750      * <P>Each privilege description has the following columns:
1751      *  <OL>
1752      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1753      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1754      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1755      *  <LI><B>GRANTOR</B> String {@code =>} grantor of access (may be <code>null</code>)
1756      *  <LI><B>GRANTEE</B> String {@code =>} grantee of access
1757      *  <LI><B>PRIVILEGE</B> String {@code =>} name of access (SELECT,
1758      *      INSERT, UPDATE, REFRENCES, ...)
1759      *  <LI><B>IS_GRANTABLE</B> String {@code =>} "YES" if grantee is permitted
1760      *      to grant to others; "NO" if not; <code>null</code> if unknown
1761      *  </OL>
1762      *
1763      * @param catalog a catalog name; must match the catalog name as it
1764      *        is stored in the database; "" retrieves those without a catalog;
1765      *        <code>null</code> means that the catalog name should not be used to narrow
1766      *        the search
1767      * @param schemaPattern a schema name pattern; must match the schema name
1768      *        as it is stored in the database; "" retrieves those without a schema;
1769      *        <code>null</code> means that the schema name should not be used to narrow
1770      *        the search
1771      * @param tableNamePattern a table name pattern; must match the
1772      *        table name as it is stored in the database
1773      * @return <code>ResultSet</code> - each row is a table privilege description
1774      * @exception SQLException if a database access error occurs
1775      * @see #getSearchStringEscape
1776      */
1777     ResultSet getTablePrivileges(String catalog, String schemaPattern,
1778                                  String tableNamePattern) throws SQLException;


2492     int typeSearchable  = 3;
2493 
2494     /**
2495      * Retrieves a description of the given table's indices and statistics. They are
2496      * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
2497      *
2498      * <P>Each index column description has the following columns:
2499      *  <OL>
2500      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
2501      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
2502      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
2503      *  <LI><B>NON_UNIQUE</B> boolean {@code =>} Can index values be non-unique.
2504      *      false when TYPE is tableIndexStatistic
2505      *  <LI><B>INDEX_QUALIFIER</B> String {@code =>} index catalog (may be <code>null</code>);
2506      *      <code>null</code> when TYPE is tableIndexStatistic
2507      *  <LI><B>INDEX_NAME</B> String {@code =>} index name; <code>null</code> when TYPE is
2508      *      tableIndexStatistic
2509      *  <LI><B>TYPE</B> short {@code =>} index type:
2510      *      <UL>
2511      *      <LI> tableIndexStatistic - this identifies table statistics that are
2512      *           returned in conjuction with a table's index descriptions
2513      *      <LI> tableIndexClustered - this is a clustered index
2514      *      <LI> tableIndexHashed - this is a hashed index
2515      *      <LI> tableIndexOther - this is some other style of index
2516      *      </UL>
2517      *  <LI><B>ORDINAL_POSITION</B> short {@code =>} column sequence number
2518      *      within index; zero when TYPE is tableIndexStatistic
2519      *  <LI><B>COLUMN_NAME</B> String {@code =>} column name; <code>null</code> when TYPE is
2520      *      tableIndexStatistic
2521      *  <LI><B>ASC_OR_DESC</B> String {@code =>} column sort sequence, "A" {@code =>} ascending,
2522      *      "D" {@code =>} descending, may be <code>null</code> if sort sequence is not supported;
2523      *      <code>null</code> when TYPE is tableIndexStatistic
2524      *  <LI><B>CARDINALITY</B> long {@code =>} When TYPE is tableIndexStatistic, then
2525      *      this is the number of rows in the table; otherwise, it is the
2526      *      number of unique values in the index.
2527      *  <LI><B>PAGES</B> long {@code =>} When TYPE is  tableIndexStatisic then
2528      *      this is the number of pages used for the table, otherwise it
2529      *      is the number of pages used for the current index.
2530      *  <LI><B>FILTER_CONDITION</B> String {@code =>} Filter condition, if any.
2531      *      (may be <code>null</code>)
2532      *  </OL>
2533      *
2534      * @param catalog a catalog name; must match the catalog name as it
2535      *        is stored in this database; "" retrieves those without a catalog;
2536      *        <code>null</code> means that the catalog name should not be used to narrow
2537      *        the search
2538      * @param schema a schema name; must match the schema name
2539      *        as it is stored in this database; "" retrieves those without a schema;
2540      *        <code>null</code> means that the schema name should not be used to narrow
2541      *        the search
2542      * @param table a table name; must match the table name as it is stored
2543      *        in this database
2544      * @param unique when true, return only indices for unique values;
2545      *     when false, return indices regardless of whether unique or not
2546      * @param approximate when true, result is allowed to reflect approximate
2547      *     or out of data values; when false, results are requested to be


2841 
2842     /**
2843      * Retrieves whether this database supports named parameters to callable
2844      * statements.
2845      *
2846      * @return <code>true</code> if named parameters are supported;
2847      *         <code>false</code> otherwise
2848      * @exception SQLException if a database access error occurs
2849      * @since 1.4
2850      */
2851     boolean supportsNamedParameters() throws SQLException;
2852 
2853     /**
2854      * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects
2855      * returned from a <code>CallableStatement</code> object
2856      * simultaneously.
2857      *
2858      * @return <code>true</code> if a <code>CallableStatement</code> object
2859      *         can return multiple <code>ResultSet</code> objects
2860      *         simultaneously; <code>false</code> otherwise
2861      * @exception SQLException if a datanase access error occurs
2862      * @since 1.4
2863      */
2864     boolean supportsMultipleOpenResults() throws SQLException;
2865 
2866     /**
2867      * Retrieves whether auto-generated keys can be retrieved after
2868      * a statement has been executed
2869      *
2870      * @return <code>true</code> if auto-generated keys can be retrieved
2871      *         after a statement has executed; <code>false</code> otherwise
2872      * <p>If <code>true</code> is returned, the JDBC driver must support the
2873      * returning of auto-generated keys for at least SQL INSERT statements
2874      *
2875      * @exception SQLException if a database access error occurs
2876      * @since 1.4
2877      */
2878     boolean supportsGetGeneratedKeys() throws SQLException;
2879 
2880     /**
2881      * Retrieves a description of the user-defined type (UDT) hierarchies defined in a


3285          * @return      A <code>ResultSet</code> object; each row is a supported client info
3286          * property
3287          *
3288          *  @exception SQLException if a database access error occurs
3289          *
3290          * @since 1.6
3291          */
3292         ResultSet getClientInfoProperties()
3293                 throws SQLException;
3294 
3295     /**
3296      * Retrieves a description of the  system and user functions available
3297      * in the given catalog.
3298      * <P>
3299      * Only system and user function descriptions matching the schema and
3300      * function name criteria are returned.  They are ordered by
3301      * <code>FUNCTION_CAT</code>, <code>FUNCTION_SCHEM</code>,
3302      * <code>FUNCTION_NAME</code> and
3303      * <code>SPECIFIC_ NAME</code>.
3304      *
3305      * <P>Each function description has the the following columns:
3306      *  <OL>
3307      *  <LI><B>FUNCTION_CAT</B> String {@code =>} function catalog (may be <code>null</code>)
3308      *  <LI><B>FUNCTION_SCHEM</B> String {@code =>} function schema (may be <code>null</code>)
3309      *  <LI><B>FUNCTION_NAME</B> String {@code =>} function name.  This is the name
3310      * used to invoke the function
3311      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the function
3312      * <LI><B>FUNCTION_TYPE</B> short {@code =>} kind of function:
3313      *      <UL>
3314      *      <LI>functionResultUnknown - Cannot determine if a return value
3315      *       or table will be returned
3316      *      <LI> functionNoTable- Does not return a table
3317      *      <LI> functionReturnsTable - Returns a table
3318      *      </UL>
3319      *  <LI><B>SPECIFIC_NAME</B> String  {@code =>} the name which uniquely identifies
3320      *  this function within its schema.  This is a user specified, or DBMS
3321      * generated, name that may be different then the <code>FUNCTION_NAME</code>
3322      * for example with overload functions
3323      *  </OL>
3324      * <p>
3325      * A user may not have permission to execute any of the functions that are


   1 /*
   2  * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


1199 
1200     /**
1201      * Retrieves whether this database ignores a data definition statement
1202      * within a transaction.
1203      *
1204      * @return <code>true</code> if so; <code>false</code> otherwise
1205      * @exception SQLException if a database access error occurs
1206      */
1207     boolean dataDefinitionIgnoredInTransactions()
1208         throws SQLException;
1209 
1210     /**
1211      * Retrieves a description of the stored procedures available in the given
1212      * catalog.
1213      * <P>
1214      * Only procedure descriptions matching the schema and
1215      * procedure name criteria are returned.  They are ordered by
1216      * <code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code>,
1217      * <code>PROCEDURE_NAME</code> and <code>SPECIFIC_ NAME</code>.
1218      *
1219      * <P>Each procedure description has the following columns:
1220      *  <OL>
1221      *  <LI><B>PROCEDURE_CAT</B> String {@code =>} procedure catalog (may be <code>null</code>)
1222      *  <LI><B>PROCEDURE_SCHEM</B> String {@code =>} procedure schema (may be <code>null</code>)
1223      *  <LI><B>PROCEDURE_NAME</B> String {@code =>} procedure name
1224      *  <LI> reserved for future use
1225      *  <LI> reserved for future use
1226      *  <LI> reserved for future use
1227      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the procedure
1228      *  <LI><B>PROCEDURE_TYPE</B> short {@code =>} kind of procedure:
1229      *      <UL>
1230      *      <LI> procedureResultUnknown - Cannot determine if  a return value
1231      *       will be returned
1232      *      <LI> procedureNoResult - Does not return a return value
1233      *      <LI> procedureReturnsResult - Returns a return value
1234      *      </UL>
1235      *  <LI><B>SPECIFIC_NAME</B> String  {@code =>} The name which uniquely identifies this
1236      * procedure within its schema.
1237      *  </OL>
1238      * <p>
1239      * A user may not have permissions to execute any of the procedures that are


1470      * returned by the method <code>getProcedureColumns</code>.
1471      */
1472     int procedureNullableUnknown = 2;
1473 
1474 
1475     /**
1476      * Retrieves a description of the tables available in the given catalog.
1477      * Only table descriptions matching the catalog, schema, table
1478      * name and type criteria are returned.  They are ordered by
1479      * <code>TABLE_TYPE</code>, <code>TABLE_CAT</code>,
1480      * <code>TABLE_SCHEM</code> and <code>TABLE_NAME</code>.
1481      * <P>
1482      * Each table description has the following columns:
1483      *  <OL>
1484      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1485      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1486      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1487      *  <LI><B>TABLE_TYPE</B> String {@code =>} table type.  Typical types are "TABLE",
1488      *                  "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
1489      *                  "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
1490      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the table (may be {@code null})
1491      *  <LI><B>TYPE_CAT</B> String {@code =>} the types catalog (may be <code>null</code>)
1492      *  <LI><B>TYPE_SCHEM</B> String {@code =>} the types schema (may be <code>null</code>)
1493      *  <LI><B>TYPE_NAME</B> String {@code =>} type name (may be <code>null</code>)
1494      *  <LI><B>SELF_REFERENCING_COL_NAME</B> String {@code =>} name of the designated
1495      *                  "identifier" column of a typed table (may be <code>null</code>)
1496      *  <LI><B>REF_GENERATION</B> String {@code =>} specifies how values in
1497      *                  SELF_REFERENCING_COL_NAME are created. Values are
1498      *                  "SYSTEM", "USER", "DERIVED". (may be <code>null</code>)
1499      *  </OL>
1500      *
1501      * <P><B>Note:</B> Some databases may not return information for
1502      * all tables.
1503      *
1504      * @param catalog a catalog name; must match the catalog name as it
1505      *        is stored in the database; "" retrieves those without a catalog;
1506      *        <code>null</code> means that the catalog name should not be used to narrow
1507      *        the search
1508      * @param schemaPattern a schema name pattern; must match the schema name
1509      *        as it is stored in the database; "" retrieves those without a schema;
1510      *        <code>null</code> means that the schema name should not be used to narrow


1693      * in the <code>ResultSet</code> returned by the method
1694      * <code>getColumns</code>.
1695      */
1696     int columnNullableUnknown = 2;
1697 
1698     /**
1699      * Retrieves a description of the access rights for a table's columns.
1700      *
1701      * <P>Only privileges matching the column name criteria are
1702      * returned.  They are ordered by COLUMN_NAME and PRIVILEGE.
1703      *
1704      * <P>Each privilege description has the following columns:
1705      *  <OL>
1706      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1707      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1708      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1709      *  <LI><B>COLUMN_NAME</B> String {@code =>} column name
1710      *  <LI><B>GRANTOR</B> String {@code =>} grantor of access (may be <code>null</code>)
1711      *  <LI><B>GRANTEE</B> String {@code =>} grantee of access
1712      *  <LI><B>PRIVILEGE</B> String {@code =>} name of access (SELECT,
1713      *      INSERT, UPDATE, REFERENCES, ...)
1714      *  <LI><B>IS_GRANTABLE</B> String {@code =>} "YES" if grantee is permitted
1715      *      to grant to others; "NO" if not; <code>null</code> if unknown
1716      *  </OL>
1717      *
1718      * @param catalog a catalog name; must match the catalog name as it
1719      *        is stored in the database; "" retrieves those without a catalog;
1720      *        <code>null</code> means that the catalog name should not be used to narrow
1721      *        the search
1722      * @param schema a schema name; must match the schema name as it is
1723      *        stored in the database; "" retrieves those without a schema;
1724      *        <code>null</code> means that the schema name should not be used to narrow
1725      *        the search
1726      * @param table a table name; must match the table name as it is
1727      *        stored in the database
1728      * @param columnNamePattern a column name pattern; must match the column
1729      *        name as it is stored in the database
1730      * @return <code>ResultSet</code> - each row is a column privilege description
1731      * @exception SQLException if a database access error occurs
1732      * @see #getSearchStringEscape
1733      */


1738      * Retrieves a description of the access rights for each table available
1739      * in a catalog. Note that a table privilege applies to one or
1740      * more columns in the table. It would be wrong to assume that
1741      * this privilege applies to all columns (this may be true for
1742      * some systems but is not true for all.)
1743      *
1744      * <P>Only privileges matching the schema and table name
1745      * criteria are returned.  They are ordered by
1746      * <code>TABLE_CAT</code>,
1747      * <code>TABLE_SCHEM</code>, <code>TABLE_NAME</code>,
1748      * and <code>PRIVILEGE</code>.
1749      *
1750      * <P>Each privilege description has the following columns:
1751      *  <OL>
1752      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
1753      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
1754      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
1755      *  <LI><B>GRANTOR</B> String {@code =>} grantor of access (may be <code>null</code>)
1756      *  <LI><B>GRANTEE</B> String {@code =>} grantee of access
1757      *  <LI><B>PRIVILEGE</B> String {@code =>} name of access (SELECT,
1758      *      INSERT, UPDATE, REFERENCES, ...)
1759      *  <LI><B>IS_GRANTABLE</B> String {@code =>} "YES" if grantee is permitted
1760      *      to grant to others; "NO" if not; <code>null</code> if unknown
1761      *  </OL>
1762      *
1763      * @param catalog a catalog name; must match the catalog name as it
1764      *        is stored in the database; "" retrieves those without a catalog;
1765      *        <code>null</code> means that the catalog name should not be used to narrow
1766      *        the search
1767      * @param schemaPattern a schema name pattern; must match the schema name
1768      *        as it is stored in the database; "" retrieves those without a schema;
1769      *        <code>null</code> means that the schema name should not be used to narrow
1770      *        the search
1771      * @param tableNamePattern a table name pattern; must match the
1772      *        table name as it is stored in the database
1773      * @return <code>ResultSet</code> - each row is a table privilege description
1774      * @exception SQLException if a database access error occurs
1775      * @see #getSearchStringEscape
1776      */
1777     ResultSet getTablePrivileges(String catalog, String schemaPattern,
1778                                  String tableNamePattern) throws SQLException;


2492     int typeSearchable  = 3;
2493 
2494     /**
2495      * Retrieves a description of the given table's indices and statistics. They are
2496      * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
2497      *
2498      * <P>Each index column description has the following columns:
2499      *  <OL>
2500      *  <LI><B>TABLE_CAT</B> String {@code =>} table catalog (may be <code>null</code>)
2501      *  <LI><B>TABLE_SCHEM</B> String {@code =>} table schema (may be <code>null</code>)
2502      *  <LI><B>TABLE_NAME</B> String {@code =>} table name
2503      *  <LI><B>NON_UNIQUE</B> boolean {@code =>} Can index values be non-unique.
2504      *      false when TYPE is tableIndexStatistic
2505      *  <LI><B>INDEX_QUALIFIER</B> String {@code =>} index catalog (may be <code>null</code>);
2506      *      <code>null</code> when TYPE is tableIndexStatistic
2507      *  <LI><B>INDEX_NAME</B> String {@code =>} index name; <code>null</code> when TYPE is
2508      *      tableIndexStatistic
2509      *  <LI><B>TYPE</B> short {@code =>} index type:
2510      *      <UL>
2511      *      <LI> tableIndexStatistic - this identifies table statistics that are
2512      *           returned in conjunction with a table's index descriptions
2513      *      <LI> tableIndexClustered - this is a clustered index
2514      *      <LI> tableIndexHashed - this is a hashed index
2515      *      <LI> tableIndexOther - this is some other style of index
2516      *      </UL>
2517      *  <LI><B>ORDINAL_POSITION</B> short {@code =>} column sequence number
2518      *      within index; zero when TYPE is tableIndexStatistic
2519      *  <LI><B>COLUMN_NAME</B> String {@code =>} column name; <code>null</code> when TYPE is
2520      *      tableIndexStatistic
2521      *  <LI><B>ASC_OR_DESC</B> String {@code =>} column sort sequence, "A" {@code =>} ascending,
2522      *      "D" {@code =>} descending, may be <code>null</code> if sort sequence is not supported;
2523      *      <code>null</code> when TYPE is tableIndexStatistic
2524      *  <LI><B>CARDINALITY</B> long {@code =>} When TYPE is tableIndexStatistic, then
2525      *      this is the number of rows in the table; otherwise, it is the
2526      *      number of unique values in the index.
2527      *  <LI><B>PAGES</B> long {@code =>} When TYPE is  tableIndexStatistic then
2528      *      this is the number of pages used for the table, otherwise it
2529      *      is the number of pages used for the current index.
2530      *  <LI><B>FILTER_CONDITION</B> String {@code =>} Filter condition, if any.
2531      *      (may be <code>null</code>)
2532      *  </OL>
2533      *
2534      * @param catalog a catalog name; must match the catalog name as it
2535      *        is stored in this database; "" retrieves those without a catalog;
2536      *        <code>null</code> means that the catalog name should not be used to narrow
2537      *        the search
2538      * @param schema a schema name; must match the schema name
2539      *        as it is stored in this database; "" retrieves those without a schema;
2540      *        <code>null</code> means that the schema name should not be used to narrow
2541      *        the search
2542      * @param table a table name; must match the table name as it is stored
2543      *        in this database
2544      * @param unique when true, return only indices for unique values;
2545      *     when false, return indices regardless of whether unique or not
2546      * @param approximate when true, result is allowed to reflect approximate
2547      *     or out of data values; when false, results are requested to be


2841 
2842     /**
2843      * Retrieves whether this database supports named parameters to callable
2844      * statements.
2845      *
2846      * @return <code>true</code> if named parameters are supported;
2847      *         <code>false</code> otherwise
2848      * @exception SQLException if a database access error occurs
2849      * @since 1.4
2850      */
2851     boolean supportsNamedParameters() throws SQLException;
2852 
2853     /**
2854      * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects
2855      * returned from a <code>CallableStatement</code> object
2856      * simultaneously.
2857      *
2858      * @return <code>true</code> if a <code>CallableStatement</code> object
2859      *         can return multiple <code>ResultSet</code> objects
2860      *         simultaneously; <code>false</code> otherwise
2861      * @exception SQLException if a database access error occurs
2862      * @since 1.4
2863      */
2864     boolean supportsMultipleOpenResults() throws SQLException;
2865 
2866     /**
2867      * Retrieves whether auto-generated keys can be retrieved after
2868      * a statement has been executed
2869      *
2870      * @return <code>true</code> if auto-generated keys can be retrieved
2871      *         after a statement has executed; <code>false</code> otherwise
2872      * <p>If <code>true</code> is returned, the JDBC driver must support the
2873      * returning of auto-generated keys for at least SQL INSERT statements
2874      *
2875      * @exception SQLException if a database access error occurs
2876      * @since 1.4
2877      */
2878     boolean supportsGetGeneratedKeys() throws SQLException;
2879 
2880     /**
2881      * Retrieves a description of the user-defined type (UDT) hierarchies defined in a


3285          * @return      A <code>ResultSet</code> object; each row is a supported client info
3286          * property
3287          *
3288          *  @exception SQLException if a database access error occurs
3289          *
3290          * @since 1.6
3291          */
3292         ResultSet getClientInfoProperties()
3293                 throws SQLException;
3294 
3295     /**
3296      * Retrieves a description of the  system and user functions available
3297      * in the given catalog.
3298      * <P>
3299      * Only system and user function descriptions matching the schema and
3300      * function name criteria are returned.  They are ordered by
3301      * <code>FUNCTION_CAT</code>, <code>FUNCTION_SCHEM</code>,
3302      * <code>FUNCTION_NAME</code> and
3303      * <code>SPECIFIC_ NAME</code>.
3304      *
3305      * <P>Each function description has the following columns:
3306      *  <OL>
3307      *  <LI><B>FUNCTION_CAT</B> String {@code =>} function catalog (may be <code>null</code>)
3308      *  <LI><B>FUNCTION_SCHEM</B> String {@code =>} function schema (may be <code>null</code>)
3309      *  <LI><B>FUNCTION_NAME</B> String {@code =>} function name.  This is the name
3310      * used to invoke the function
3311      *  <LI><B>REMARKS</B> String {@code =>} explanatory comment on the function
3312      * <LI><B>FUNCTION_TYPE</B> short {@code =>} kind of function:
3313      *      <UL>
3314      *      <LI>functionResultUnknown - Cannot determine if a return value
3315      *       or table will be returned
3316      *      <LI> functionNoTable- Does not return a table
3317      *      <LI> functionReturnsTable - Returns a table
3318      *      </UL>
3319      *  <LI><B>SPECIFIC_NAME</B> String  {@code =>} the name which uniquely identifies
3320      *  this function within its schema.  This is a user specified, or DBMS
3321      * generated, name that may be different then the <code>FUNCTION_NAME</code>
3322      * for example with overload functions
3323      *  </OL>
3324      * <p>
3325      * A user may not have permission to execute any of the functions that are