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.
4
4
This file is part of GNU Classpath.
257
257
short tableIndexOther = 3;
260
* A NULL value is not allowed for this attribute.
259
262
short attributeNoNulls = 0;
265
* A NULL value is allowed for this attribute.
261
267
short attributeNullable = 1;
270
* It is unknown whether or not NULL values are allowed for this attribute.
263
272
short attributeNullableUnknown = 2;
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.
1402
1411
ResultSet getProcedures(String catalog, String schemaPattern, String
1403
procedureNamePattern) throws SQLException;
1412
procedurePattern) throws SQLException;
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.
1444
1453
ResultSet getProcedureColumns(String catalog, String schemaPattern,
1445
String procedureNamePattern, String columnNamePattern) throws
1454
String procedurePattern, String columnPattern) throws
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.
1470
1479
ResultSet getTables(String catalog, String schemaPattern, String
1471
tableNamePattern, String[] types) throws SQLException;
1480
tablePattern, String[] types) throws SQLException;
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.
1544
1553
ResultSet getColumns(String catalog, String schemaPattern, String
1545
tableNamePattern, String columnNamePattern) throws SQLException;
1554
tablePattern, String columnPattern) throws SQLException;
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.
1576
1585
ResultSet getColumnPrivileges(String catalog, String schema, String
1577
table, String columnNamePattern) throws SQLException;
1586
tableName, String columnPattern) throws SQLException;
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.
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.
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;
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.
1678
1685
ResultSet getVersionColumns(String catalog, String schema,
1679
String table) throws SQLException;
1686
String tableName) throws SQLException;
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.
1704
ResultSet getPrimaryKeys(String catalog, String schema, String table)
1710
ResultSet getPrimaryKeys(String catalog, String schema, String tableName)
1705
1711
throws SQLException;
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.
1749
* @param tableName The table name to return information for.
1745
1750
* @return A <code>ResultSet</code> with the foreign key columns.
1747
1751
* @exception SQLException If an error occurs.
1749
1753
ResultSet getImportedKeys(String catalog, String schema,
1750
String table) throws SQLException;
1754
String tableName) throws SQLException;
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.
1793
1797
ResultSet getExportedKeys(String catalog, String schema,
1794
String table) throws SQLException;
1798
String tableName) throws SQLException;
1797
1801
* This method returns a description of how one table imports another
1825
1829
* <code>importedKeyNotDeferrable</code>).</li>
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
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
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
1836
* @param primarySchema The schema to retrieve information from, or the empty
1837
* string to return entities not associated with a schema, on the
1839
* @param primaryTableName The table name to return information for, on the
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
1842
1850
* @return A <code>ResultSet</code> with the requested information
1843
1851
* @exception SQLException If an error occurs.
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;
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.
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;
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
2117
2125
* @exception SQLException If an error occurs.
2119
2127
ResultSet getUDTs(String catalog, String schemaPattern, String
2120
typeNamePattern, int[] types) throws SQLException;
2128
typePattern, int[] types) throws SQLException;
2123
2131
* This method returns the <code>Connection</code> object that was used
2129
2137
Connection getConnection() throws SQLException;
2140
* This method tests whether the databse supports savepoints.
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.
2134
2148
boolean supportsSavepoints() throws SQLException;
2151
* This method tests whether the database supports named parameters.
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.
2139
2158
boolean supportsNamedParameters() throws SQLException;
2161
* This method tests whether the database supports returning multiple
2162
* <code>ResultSet</code>S from a <code>CallableStatement</code> at once.
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.
2144
2169
boolean supportsMultipleOpenResults() throws SQLException;
2154
2179
ResultSet getSuperTypes(String catalog, String schemaPattern,
2155
String typeNamePattern) throws SQLException;
2180
String typePattern) throws SQLException;
2160
2185
ResultSet getSuperTables(String catalog, String schemaPattern,
2161
String tableNamePattern) throws SQLException;
2186
String tablePattern) throws SQLException;
2166
2191
ResultSet getAttributes(String catalog, String schemaPattern, String
2167
typeNamePattern, String attributeNamePattern) throws SQLException;
2192
typePattern, String attributePattern) throws SQLException;
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.
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.
2172
2206
boolean supportsResultSetHoldability(int holdability)
2173
2207
throws SQLException;
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.
2214
* @return The default holdability type.
2215
* @exception SQLException If an error occurs.
2178
2218
int getResultSetHoldability() throws SQLException;
2221
* This method returns the major version number of the database.
2223
* @return The major version number of the database.
2224
* @exception SQLException If an error occurs.
2183
2227
int getDatabaseMajorVersion() throws SQLException;
2230
* This method returns the minor version number of the database.
2232
* @return The minor version number of the database.
2233
* @exception SQLException If an error occurs.
2188
2236
int getDatabaseMinorVersion() throws SQLException;
2239
* This method returns the major version number of the JDBC driver.
2241
* @return The major version number of the JDBC driver.
2242
* @exception SQLException If an error occurs.
2193
2245
int getJDBCMajorVersion() throws SQLException;
2248
* This method returns the minor version number of the JDBC driver.
2250
* @return The minor version number of the database.
2251
* @exception SQLException If an error occurs.
2198
2254
int getJDBCMinorVersion() throws SQLException;