8.6.10 getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern)
- Organization of this subsection
(1) Function
This method acquires information related to a specified attribute of a specified type for user-defined types (UDTs) that can be used in specified schemas and catalogs.
(2) Format
public synchronized ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException
(3) Arguments
- String catalog
-
Specifies a catalog name. This argument is ignored, if specified.
- String schemaPattern
-
Specifies a schema name pattern. This argument is ignored, if specified.
- String typeNamePattern
-
Specifies a type name pattern. This argument is ignored, if specified.
- String attributeNamePattern
-
Specifies an attribute name pattern. This argument is ignored, if specified.
(4) Return value
This method always returns a ResultSet object that contains no retrieval result rows. The following table shows the format of the ResultSet object that is returned.
|
Column No. |
Type |
Column name |
Description |
|---|---|---|---|
|
1 |
String |
TYPE_CAT |
Catalog name |
|
2 |
String |
TYPE_SCHEM |
Schema name |
|
3 |
String |
TYPE_NAME |
Type name |
|
4 |
String |
ATTR_NAME |
Attribute name |
|
5 |
int |
DATA_TYPE |
Attribute type of SQL type |
|
6 |
String |
ATTR_TYPE_NAME |
Type name |
|
7 |
int |
ATTR_SIZE |
Column size |
|
8 |
int |
DECIMAL_DIGITS |
Decimal places |
|
9 |
int |
NUM_PREC_RADIX |
Radix |
|
10 |
int |
NULLABLE |
Whether the NULL value is permitted |
|
11 |
String |
REMARKS |
Comment column |
|
12 |
String |
ATTR_DEF |
Default value |
|
13 |
int |
SQL_DATA_TYPE |
Not used |
|
14 |
int |
SQL_DATETIME_SUB |
Not used |
|
15 |
int |
CHAR_OCTET_LENGTH |
Maximum length (in bytes) of a CHAR-type column |
|
16 |
int |
ORDINAL_POSITION |
Column number |
|
17 |
String |
IS_NULLABLE |
Whether the NULL value is permitted |
|
18 |
String |
SCOPE_CATALOG |
Catalog name for a table in the scope of reference attribute |
|
19 |
String |
SCOPE_SCHEMA |
Schema name for a table in the scope of reference attribute |
|
20 |
String |
SCOPE_TABLE |
Name for a table in the scope of reference attribute |
|
21 |
short |
SOURCE_DATA_TYPE |
Source data type for individual types, user-defined Ref type, or java.sql.Types SQL type |
(5) Exceptions
If this Connection object is closed before this method is executed, the JDBC driver throws an SQLException.