Nonstop Database, HiRDB Version 9 UAP Development Guide
The ResultSetMetaData interface provides the following principal function:
The table below lists the methods of the ResultSetMetaData interface. The interface does not support methods that are not listed in the table. If an unsupported method is specified, the interface throws an SQLException.
Table 18-46 ResultSetMetaData interface methods
| Subsection | Method | Function |
|---|---|---|
| (a) | getCatalogName(int column) | Returns the catalog name for a specified column number of a table. |
| (b) | getColumnClassName(int column) | Returns the fully specified Java class name for a specified column. |
| (c) | getColumnCount() | Returns the number of columns in this ResultSet object. |
| (d) | getColumnDisplaySize(int column) | Returns a specified column's maximum width (in characters). |
| (e) | getColumnLabel(int column) | Returns a recommended print or display title for a specified column. |
| (f) | getColumnName(int column) | Returns a specified column's column name. |
| (g) | getColumnType(int column) | Returns a specified column's SQL data type. |
| (h) | getColumnTypeName(int column) | Returns a specified column's database-specific format name. |
| (i) | getPrecision(int column) | Returns a specified column's length in decimal digits. |
| (j) | getScale(int column) | Returns the number of decimal places in a specified column. |
| (k) | getSchemaName(int column) | Returns a specified column's table schema. |
| (l) | getTableName(int column) | Returns the table name for a specified column. |
| (m) | isAutoIncrement(int column) | Returns a value indicating whether a specified column is both numbered automatically and treated as being read-only. |
| (n) | isCaseSensitive(int column) | Returns a value indicating whether a specified column is case sensitive. |
| (o) | isCurrency(int column) | Returns a value indicating whether a specified column is for currency values. |
| (p) | isDefinitelyWritable(int column) | Returns a value indicating whether write operations on a specified column will be successful. |
| (q) | isNullable(int column) | Returns a value indicating whether the NULL value can be set in a specified column. |
| (r) | isReadOnly(int column) | Returns a value indicating whether a specified column's value is read-only. |
| (s) | isSearchable(int column) | Returns a value indicating whether a specified column can be used in a where section. |
| (t) | isSigned(int column) | Returns a value indicating whether a specified column is for signed numeric values. |
| (u) | isWritable(int column) | Returns a value indicating whether write operations on a specified column can be successful. |
public synchronized String getCatalogName(int column) throws SQLException
public synchronized String getColumnClassName(int column) throws SQLException
Table 18-47 Character strings returned by getColumnClassName
| Column's HiRDB data type | Character string returned |
|---|---|
| BLOB | "java.lang.Object" |
| BINARY | "java.lang.Object" |
| INTEGER | "java.lang.Integer" |
| SMALLINT | "java.lang.Integer" |
| FLOAT DOUBLE PRECISION |
"java.lang.Double" |
| SMALLFLT REAL |
"java.lang.Float" |
| DECIMAL NUMERIC |
"java.math.BigDecimal" |
| CHAR | "java.lang.String" |
| MCHAR | "java.lang.String" |
| NCHAR | "java.lang.String" |
| VARCHAR | "java.lang.String" |
| MVARCHAR | "java.lang.String" |
| NVARCHAR | "java.lang.String" |
| DATE | "java.sql.Date" |
| TIME | "java.sql.Time" |
| TIMESTAMP | "java.sql.Timestamp" |
| BOOLEAN (column found only in a ResultSet created from DatabaseMetaData) | "java.lang.Boolean" |
public synchronized int getColumnCount()
public synchronized int getColumnDisplaySize(int column) throws SQLException
Table 18-48 Maximum width (in number of characters) returned by getColumnDisplaySize
| Column's HiRDB data type | Maximum width returned (number of characters) |
|---|---|
| BLOB(n) BINARY(n) |
n |
| INTEGER | 11 |
| SMALLINT | 6 |
| FLOAT DOUBLE PRECISION |
23 |
| SMALLFLT REAL |
13 |
| DECIMAL(n,m) NUMERIC(n,m) |
n + 2 |
| CHAR(n) MCHAR(n) NCHAR(n) VARCHAR(n) MVARCHAR(n) NVARCHAR(n) |
n |
| DATE | 10 |
| TIME | 8 |
| TIMESTAMP(n) | n > 0: 19 + (n + 1) n = 0: 19 |
| BOOLEAN (column found only in a ResultSet created from DatabaseMetaData) | 5 |
public synchronized String getColumnLabel(int column) throws SQLException
public synchronized String getColumnName(int column) throws SQLException
public synchronized int getColumnType(int column) throws SQLException
public synchronized String getColumnTypeName(int column) throws SQLException
Table 18-49 Character strings returned by getColumnTypeName
| Column's HiRDB data type | Character string returned |
|---|---|
| BLOB | "BLOB" |
| BINARY | "BINARY" |
| INTEGER | "INTEGER" |
| SMALLINT | "SMALLINT" |
| FLOAT | "FLOAT" |
| REAL | "REAL" |
| DECIMAL | "DECIMAL" |
| CHAR | "CHAR" |
| MCHAR | "MCHAR" |
| NCHAR | "NCHAR" |
| VARCHAR | "VARCHAR" |
| MVARCHAR | "MVARCHAR" |
| NVARCHAR | "NVARCHAR" |
| DATE | "DATE" |
| TIME | "TIME" |
| TIMESTAMP | "TIMESTAMP" |
| BOOLEAN (column found only in a ResultSet created from DatabaseMetaData) | "BOOLEAN" |
public synchronized int getPrecision(int column) throws SQLException
Table 18-50 Return value of getPrecision
| Column's HiRDB data type | Return value |
|---|---|
| BLOB(n), BINARY(n) | n |
| INTEGER | 10 |
| SMALLINT | 5 |
| FLOAT, DOUBLE PRECISION | 15 |
| SMALLFLT, REAL | 7 |
| DECIMAL(n,m), NUMERIC(n,m) | n |
| CHAR(n), MCHAR(n), VARCHAR(n), MVARCHAR(n) | n |
| NCHAR(n), NVARCHAR(n) | n x 2 |
| DATE | 10 |
| TIME | 8 |
| TIMESTAMP(n) | n > 0: 19 + (n + 1) n = 0: 19 |
| BOOLEAN (column found only in a ResultSet created from DatabaseMetaData) | 1 |
public synchronized int getScale(int column) throws SQLException
Table 18-51 Value returned by getScale
| Column's HiRDB data type | Return value |
|---|---|
| DECIMAL NUMERIC |
Decimal places |
| TIMESTAMP | Number of digits below a millisecond |
| Other | 0 |
public synchronized String getSchemaName(int column) throws SQLException
public synchronized String getTableName(int column) throws SQLException
public synchronized boolean isAutoIncrement(int column) throws SQLException
public synchronized boolean isCaseSensitive(int column) throws SQLException
public synchronized boolean isCurrency(int column) throws SQLException
public synchronized boolean isDefinitelyWritable(int column) throws SQLException
public synchronized int isNullable(int column) throws SQLException
public synchronized boolean isReadOnly(int column) throws SQLException
public synchronized boolean isSearchable(int column) throws SQLException
public synchronized boolean isSigned(int column) throws SQLException
Table 18-52 Value returned by isSigned
| Column's HiRDB data type | Return value |
|---|---|
| INTEGER SMALLINT FLOAT DOUBLE PRECISION REAL SMALLFLT DECIMAL NUMERIC |
true |
| Other | false |
public synchronized boolean isWritable(int column) throws SQLException
The names of the package and class for installing this interface are as follows:
The getColumnName and getColumnLabel methods get retrieval item names from SQLNAME in the Column Name Descriptor Area (SQLCNDA) that the HiRDB driver sends to the JDBC driver. The methods then convert the names to Java internal codes and return them. For a description of the return values of these methods for specified columns, see C.1 Organization and contents of the Column Name Descriptor Area.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.