~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to java/sql/DatabaseMetaData.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* DatabaseMetaData.java -- Information about the database itself.
2
 
   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
2
   Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
3
3
 
4
4
This file is part of GNU Classpath.
5
5
 
256
256
   */
257
257
  short tableIndexOther = 3;
258
258
 
 
259
  /**
 
260
   * A NULL value is not allowed for this attribute.
 
261
   */
259
262
  short attributeNoNulls = 0;
260
263
 
 
264
  /**
 
265
   * A NULL value is allowed for this attribute.
 
266
   */
261
267
  short attributeNullable = 1;
262
268
 
 
269
  /**
 
270
   * It is unknown whether or not NULL values are allowed for this attribute.
 
271
   */
263
272
  short attributeNullableUnknown = 2;
264
273
 
265
274
  int sqlStateXOpen = 1;
1395
1404
   *        or "" to return procedures from all catalogs.
1396
1405
   * @param schemaPattern A schema pattern for the schemas to return stored
1397
1406
   *        procedures from, or "" to return procedures from all schemas.
1398
 
   * @param namePattern The pattern of procedures names to return.
 
1407
   * @param procedurePattern The pattern of procedure names to return.
1399
1408
   * @returns A <code>ResultSet</code> with all the requested procedures.
1400
1409
   * @exception SQLException If an error occurs.
1401
1410
   */
1402
1411
  ResultSet getProcedures(String catalog, String schemaPattern, String
1403
 
      procedureNamePattern) throws SQLException;
 
1412
      procedurePattern) throws SQLException;
1404
1413
 
1405
1414
  /**
1406
1415
   * This method returns a list of the parameter and result columns for
1436
1445
   *        or "" to return procedures from all catalogs.
1437
1446
   * @param schemaPattern A schema pattern for the schemas to return stored
1438
1447
   *        procedures from, or "" to return procedures from all schemas.
1439
 
   * @param namePattern The pattern of procedures names to return.
 
1448
   * @param procedurePattern The pattern of procedures names to return.
1440
1449
   * @param columnPattern The pattern of column names to return.
1441
1450
   * @returns A <code>ResultSet</code> with all the requested procedures.
1442
1451
   * @exception SQLException If an error occurs.
1443
1452
   */
1444
1453
  ResultSet getProcedureColumns(String catalog, String schemaPattern,
1445
 
      String procedureNamePattern, String columnNamePattern) throws
 
1454
      String procedurePattern, String columnPattern) throws
1446
1455
      SQLException;
1447
1456
 
1448
1457
  /**
1462
1471
   *        or "" to return tables from all catalogs.
1463
1472
   * @param schemaPattern A schema pattern for the schemas to return tables
1464
1473
   *        from, or "" to return tables from all schemas.
1465
 
   * @param namePattern The pattern of table names to return.
 
1474
   * @param tablePattern The pattern of table names to return.
1466
1475
   * @param types The list of table types to include; null returns all types.
1467
1476
   * @returns A <code>ResultSet</code> with all the requested tables.
1468
1477
   * @exception SQLException If an error occurs.
1469
1478
   */
1470
1479
  ResultSet getTables(String catalog, String schemaPattern, String
1471
 
      tableNamePattern, String[] types) throws SQLException;
 
1480
      tablePattern, String[] types) throws SQLException;
1472
1481
 
1473
1482
  /**
1474
1483
   * This method returns the list of database schemas as a 
1536
1545
   * or "" to return tables from all catalogs.
1537
1546
   * @param schemaPattern A schema pattern for the schemas to return 
1538
1547
   * tables from, or "" to return tables from all schemas.
1539
 
   * @param namePattern The pattern of tables names to return.
 
1548
   * @param tablePattern The pattern of table names to return.
1540
1549
   * @param columnPattern The pattern of column names to return.
1541
1550
   * @returns A <code>ResultSet</code> with all the requested tables.
1542
1551
   * @exception SQLException If an error occurs.
1543
1552
   */
1544
1553
  ResultSet getColumns(String catalog, String schemaPattern, String
1545
 
      tableNamePattern, String columnNamePattern) throws SQLException;
 
1554
      tablePattern, String columnPattern) throws SQLException;
1546
1555
 
1547
1556
  /**
1548
1557
   * This method returns the access rights that have been granted to the
1568
1577
   *        to return information from all catalogs.
1569
1578
   * @param schema The schema to retrieve information from, or the empty string
1570
1579
   *        to return entities not associated with a schema.
1571
 
   * @param table The table name to return information for.
 
1580
   * @param tableName The table name to return information for.
1572
1581
   * @param columnPattern A pattern of column names to return information for.
1573
1582
   * @return A <code>ResultSet</code> with all the requested privileges.
1574
1583
   * @exception SQLException If an error occurs.
1575
1584
   */
1576
1585
  ResultSet getColumnPrivileges(String catalog, String schema, String
1577
 
      table, String columnNamePattern) throws SQLException;
 
1586
      tableName, String columnPattern) throws SQLException;
1578
1587
 
1579
1588
  /**
1580
1589
   * This method returns the access rights that have been granted to the
1597
1606
   * @param catalog The catalog to retrieve information from, or the empty string
1598
1607
   *        to return entities not associated with a catalog, or <code>null</code>
1599
1608
   *        to return information from all catalogs.
1600
 
   * @param schema The schema to retrieve information from, or the empty string
 
1609
   * @param schemaPattern The schema to retrieve information from, or the empty string
1601
1610
   *        to return entities not associated with a schema.
1602
1611
   * @param tablePattern The table name pattern of tables to return 
1603
1612
   *        information for.
1605
1614
   * @exception SQLException If an error occurs.
1606
1615
   */
1607
1616
  ResultSet getTablePrivileges(String catalog, String schemaPattern,
1608
 
      String tableNamePattern) throws SQLException;
 
1617
      String tablePattern) throws SQLException;
1609
1618
 
1610
1619
  /**
1611
1620
   * This method returns the best set of columns for uniquely identifying
1634
1643
   * to return information from all catalogs.
1635
1644
   * @param schema The schema to retrieve information from, or the empty string
1636
1645
   * to return entities not associated with a schema.
1637
 
   * @param table The table name to return information for.
1638
 
   * @param columnPattern A pattern of column names to return information for.
 
1646
   * @param tableName The table name to return information for.
1639
1647
   * @param scope One of the best row id scope constants from this class.
1640
1648
   * @param nullable <code>true</code> to include columns that are nullable,
1641
1649
   * <code>false</code> otherwise.
1643
1651
   * @exception SQLException If an error occurs.
1644
1652
   */
1645
1653
  ResultSet getBestRowIdentifier(String catalog, String schema,
1646
 
    String table, int scope, boolean nullable) throws SQLException;
 
1654
    String tableName, int scope, boolean nullable) throws SQLException;
1647
1655
 
1648
1656
  /**
1649
1657
   * This method returns the set of columns that are automatically updated
1670
1678
   *        to return information from all catalogs.
1671
1679
   * @param schema The schema to retrieve information from, or the empty string
1672
1680
   *        to return entities not associated with a schema.
1673
 
   * @param table The table name to return information for.
1674
 
   * @param columnPattern A pattern of column names to return information for.
 
1681
   * @param tableName The table name to return information for
1675
1682
   * @return A <code>ResultSet</code> with the version columns.
1676
1683
   * @exception SQLException If an error occurs.
1677
1684
   */
1678
1685
  ResultSet getVersionColumns(String catalog, String schema,
1679
 
    String table) throws SQLException;
 
1686
    String tableName) throws SQLException;
1680
1687
 
1681
1688
  /**
1682
1689
   * This method returns a list of a table's primary key columns.  These
1696
1703
   *        to return information from all catalogs.
1697
1704
   * @param schema The schema to retrieve information from, or the empty string
1698
1705
   *        to return entities not associated with a schema.
1699
 
   * @param table The table name to return information for.
1700
 
   * @param columnPattern A pattern of column names to return information for.
 
1706
   * @param tableName The table name to return information for.
1701
1707
   * @return A <code>ResultSet</code> with the primary key columns.
1702
1708
   * @exception SQLException If an error occurs.
1703
1709
   */
1704
 
  ResultSet getPrimaryKeys(String catalog, String schema, String table)
 
1710
  ResultSet getPrimaryKeys(String catalog, String schema, String tableName)
1705
1711
      throws SQLException;
1706
1712
 
1707
1713
  /**
1740
1746
   *        to return information from all catalogs.
1741
1747
   * @param schema The schema to retrieve information from, or the empty string
1742
1748
   *        to return entities not associated with a schema.
1743
 
   * @param table The table name to return information for.
1744
 
   *
 
1749
   * @param tableName The table name to return information for.
1745
1750
   * @return A <code>ResultSet</code> with the foreign key columns.
1746
 
   *
1747
1751
   * @exception SQLException If an error occurs.
1748
1752
   */
1749
1753
  ResultSet getImportedKeys(String catalog, String schema,
1750
 
    String table) throws SQLException;
 
1754
    String tableName) throws SQLException;
1751
1755
 
1752
1756
  /**
1753
1757
   * This method returns a list of the table's which use this table's
1786
1790
   *        to return information from all catalogs.
1787
1791
   * @param schema The schema to retrieve information from, or the empty string
1788
1792
   *        to return entities not associated with a schema.
1789
 
   * @param table The table name to return information for.
 
1793
   * @param tableName The table name to return information for.
1790
1794
   * @return A <code>ResultSet</code> with the requested information
1791
1795
   * @exception SQLException If an error occurs.
1792
1796
   */
1793
1797
  ResultSet getExportedKeys(String catalog, String schema,
1794
 
    String table) throws SQLException;
 
1798
    String tableName) throws SQLException;
1795
1799
 
1796
1800
  /**
1797
1801
   * This method returns a description of how one table imports another
1825
1829
   * <code>importedKeyNotDeferrable</code>).</li>
1826
1830
   * </ol>
1827
1831
   *
1828
 
   * @param primCatalog The catalog to retrieve information from, or the empty string
1829
 
   *        to return entities not associated with a catalog, or <code>null</code>
1830
 
   *        to return information from all catalogs, on the exporting side.
1831
 
   * @param primSchema The schema to retrieve information from, or the empty string
1832
 
   *        to return entities not associated with a schema, on the exporting side.
1833
 
   * @param primTable The table name to return information for, on the exporting
1834
 
   *        side.
1835
 
   * @param forCatalog The catalog to retrieve information from, or the empty string
1836
 
   *        to return entities not associated with a catalog, or <code>null</code>
1837
 
   *        to return information from all catalogs, on the importing side.
1838
 
   * @param forSchema The schema to retrieve information from, or the empty string
1839
 
   *        to return entities not associated with a schema on the importing side.
1840
 
   * @param forTable The table name to return information for on the importing
1841
 
   *        side.
 
1832
   * @param primaryCatalog The catalog to retrieve information from, or the
 
1833
   *        empty string to return entities not associated with a catalog, or
 
1834
   *        <code>null</code> to return information from all catalogs, on the
 
1835
   *         exporting side.
 
1836
   * @param primarySchema The schema to retrieve information from, or the empty
 
1837
   *        string to return entities not associated with a schema, on the
 
1838
   *        exporting side.
 
1839
   * @param primaryTableName The table name to return information for, on the
 
1840
   *        exporting side.
 
1841
   * @param foreignCatalog The catalog to retrieve information from, or the
 
1842
   *        empty string to return entities not associated with a catalog,
 
1843
   *        or <code>null</code> to return information from all catalogs, on
 
1844
   *        the importing side.
 
1845
   * @param foreignSchema The schema to retrieve information from, or the
 
1846
   *        empty string to return entities not associated with a schema on
 
1847
   *        the importing side.
 
1848
   * @param foreignTableName The table name to return information for on the
 
1849
   *        importing side.
1842
1850
   * @return A <code>ResultSet</code> with the requested information
1843
1851
   * @exception SQLException If an error occurs.
1844
1852
   */
1845
1853
  ResultSet getCrossReference(String primaryCatalog, String
1846
 
    primarySchema, String primaryTable, String foreignCatalog, String
1847
 
    foreignSchema, String foreignTable) throws SQLException;
 
1854
    primarySchema, String primaryTableName, String foreignCatalog, String
 
1855
    foreignSchema, String foreignTableName) throws SQLException;
1848
1856
 
1849
1857
  /**
1850
1858
   * This method returns a list of the SQL types supported by this
1921
1929
   *        <code>null</code> to return information from all catalogs.
1922
1930
   * @param schema The schema to retrieve information from, or the empty string
1923
1931
   *        to return entities not associated with a schema.
1924
 
   * @param table The table name to return information for.
 
1932
   * @param tableName The table name to return information for.
1925
1933
   * @param unique <code>true</code> to return only unique indexes, 
1926
1934
   *        <code>false</code> otherwise.
1927
 
   * @param approx <code>true</code> if data values can be approximations,
 
1935
   * @param approximate <code>true</code> if data values can be approximations,
1928
1936
   *        <code>false</code> otherwise.
1929
1937
   * @return A <code>ResultSet</code> with the requested index information
1930
1938
   * @exception SQLException If an error occurs.
1931
1939
   */
1932
 
  ResultSet getIndexInfo(String catalog, String schema, String table,
 
1940
  ResultSet getIndexInfo(String catalog, String schema, String tableName,
1933
1941
    boolean unique, boolean approximate) throws SQLException;
1934
1942
 
1935
1943
  /**
1954
1962
   *
1955
1963
   * @param type The desired result type, which is one of the constants
1956
1964
   *        defined in <code>ResultSet</code>.
1957
 
   * @param concur The desired concurrency type, which is one of the constants
1958
 
   *        defined in <code>ResultSet</code>.
 
1965
   * @param concurrency The desired concurrency type, which is one of the
 
1966
   *                    constants defined in <code>ResultSet</code>.
1959
1967
   * @return <code>true</code> if the result set type is supported,
1960
1968
   *         <code>false</code> otherwise.
1961
1969
   * @exception SQLException If an error occurs.
2108
2116
   * @param catalog The catalog to retrieve information from, or the empty string
2109
2117
   *        to return entities not associated with a catalog, or <code>null</code>
2110
2118
   *        to return information from all catalogs.
2111
 
   * @param schema The schema to retrieve information from, or the empty string
2112
 
   *        to return entities not associated with a schema.
 
2119
   * @param schemaPattern The schema to retrieve information from, or the
 
2120
   *        empty string to return entities not associated with a schema.
2113
2121
   * @param typePattern The type name pattern to match.
2114
2122
   * @param types The type identifier patterns (from <code>Types</code>) to
2115
2123
   *        match.
2117
2125
   * @exception SQLException If an error occurs.
2118
2126
   */
2119
2127
  ResultSet getUDTs(String catalog, String schemaPattern, String
2120
 
      typeNamePattern, int[] types) throws SQLException;
 
2128
      typePattern, int[] types) throws SQLException;
2121
2129
 
2122
2130
  /**
2123
2131
   * This method returns the <code>Connection</code> object that was used
2129
2137
  Connection getConnection() throws SQLException;
2130
2138
 
2131
2139
  /**
 
2140
   * This method tests whether the databse supports savepoints.
 
2141
   * 
 
2142
   * @return <code>true</code> if the database supports savepoints,
 
2143
   *         <code>false</code> if it does not.
 
2144
   * @exception SQLException If an error occurs.
 
2145
   * @see Savepoint
2132
2146
   * @since 1.4
2133
2147
   */
2134
2148
  boolean supportsSavepoints() throws SQLException;
2135
2149
 
2136
2150
  /**
 
2151
   * This method tests whether the database supports named parameters.
 
2152
   * 
 
2153
   * @return <code>true</code> if the database supports named parameters,
 
2154
   *         <code>false</code> if it does not.
 
2155
   * @exception SQLException If an error occurs.
2137
2156
   * @since 1.4
2138
2157
   */
2139
2158
  boolean supportsNamedParameters() throws SQLException;
2140
2159
 
2141
2160
  /**
 
2161
   * This method tests whether the database supports returning multiple
 
2162
   * <code>ResultSet</code>S from a <code>CallableStatement</code> at once.
 
2163
   * 
 
2164
   * @return <code>true</code> if the database supports returnig multiple
 
2165
   *         results at once, <code>false</code> if it does not.
 
2166
   * @exception SQLException If an error occurs.
2142
2167
   * @since 1.4
2143
2168
   */
2144
2169
  boolean supportsMultipleOpenResults() throws SQLException;
2152
2177
   * @since 1.4
2153
2178
   */
2154
2179
  ResultSet getSuperTypes(String catalog, String schemaPattern,
2155
 
    String typeNamePattern) throws SQLException;
 
2180
    String typePattern) throws SQLException;
2156
2181
 
2157
2182
  /**
2158
2183
   * @since 1.4
2159
2184
   */
2160
2185
  ResultSet getSuperTables(String catalog, String schemaPattern,
2161
 
    String tableNamePattern) throws SQLException;
 
2186
    String tablePattern) throws SQLException;
2162
2187
 
2163
2188
  /**
2164
2189
   * @since 1.4
2165
2190
   */
2166
2191
  ResultSet getAttributes(String catalog, String schemaPattern, String
2167
 
    typeNamePattern, String attributeNamePattern) throws SQLException;
 
2192
    typePattern, String attributePattern) throws SQLException;
2168
2193
 
2169
2194
  /**
 
2195
   * This method tests if the database supports the specified holdability type.
 
2196
   * Valid values for this parameter are specified in the
 
2197
   * <code>ResultSet</code> class.
 
2198
   * 
 
2199
   * @param holdability The holdability type to test.
 
2200
   * @return <code>true</code> if the database supports the holdability type,
 
2201
   *         <code>false</code> if it does not.
 
2202
   * @exception SQLException If an error occurs.
 
2203
   * @see ResultSet
2170
2204
   * @since 1.4
2171
2205
   */
2172
2206
  boolean supportsResultSetHoldability(int holdability)
2173
2207
    throws SQLException;
2174
2208
 
2175
2209
  /**
 
2210
   * This method returns the default holdability type of <code>ResultSet</code>S
 
2211
   * retrieved from this database. The possible values are specified in the
 
2212
   * <code>ResultSet</code> class.
 
2213
   * 
 
2214
   * @return The default holdability type.
 
2215
   * @exception SQLException If an error occurs.
2176
2216
   * @since 1.4
2177
2217
   */
2178
2218
  int getResultSetHoldability() throws SQLException;
2179
2219
 
2180
2220
  /**
 
2221
   * This method returns the major version number of the database.
 
2222
   * 
 
2223
   * @return The major version number of the database.
 
2224
   * @exception SQLException If an error occurs.
2181
2225
   * @since 1.4
2182
2226
   */
2183
2227
  int getDatabaseMajorVersion() throws SQLException;
2184
2228
 
2185
2229
  /**
 
2230
   * This method returns the minor version number of the database.
 
2231
   * 
 
2232
   * @return The minor version number of the database.
 
2233
   * @exception SQLException If an error occurs.
2186
2234
   * @since 1.4
2187
2235
   */
2188
2236
  int getDatabaseMinorVersion() throws SQLException;
2189
2237
 
2190
2238
  /**
 
2239
   * This method returns the major version number of the JDBC driver.
 
2240
   * 
 
2241
   * @return The major version number of the JDBC driver.
 
2242
   * @exception  SQLException If an error occurs.
2191
2243
   * @since 1.4
2192
2244
   */
2193
2245
  int getJDBCMajorVersion() throws SQLException;
2194
2246
 
2195
2247
  /**
 
2248
   * This method returns the minor version number of the JDBC driver.
 
2249
   * 
 
2250
   * @return The minor version number of the database.
 
2251
   * @exception SQLException If an error occurs.
2196
2252
   * @since 1.4
2197
2253
   */
2198
2254
  int getJDBCMinorVersion() throws SQLException;