Hitachi

Hitachi Advanced Database Application Development Guide


8.7.3 getColumnClassName(int column)

Organization of this subsection

(1) Function

This method acquires the fully specified Java class name for the data type of a column.

(2) Format

public synchronized String getColumnClassName(int column) throws SQLException

(3) Arguments

int column

Specifies a column number (where the first column is 1).

(4) Return value

The method returns a String object.

This method returns the result of executing the getObject method of the ResultSet object on a column as the String Java class type. The following table shows the column data types and corresponding return values.

Table 8‒71: Character strings returned when the getColumnClassName method is executed

Column's data type (HADB data type)

Character string returned

INTEGER

"java.lang.Long"

SMALLINT

"java.lang.Integer"

"java.lang.Short"#

DOUBLE PRECISION

"java.lang.Double"

DECIMAL

"java.math.BigDecimal"

CHAR

"java.lang.String"

VARCHAR

"java.lang.String"

DATE

"java.sql.Date"

TIME

"java.sql.Time"

TIMESTAMP

"java.sql.Timestamp"

BINARY

"java.lang.Object"

VARBINARY

"java.lang.Object"

ROW

"java.lang.Object"

BOOLEAN (column found only in a ResultSet created from DatabaseMetaData)

"java.lang.Boolean"

#

This column is found only in a ResultSet created from DatabaseMetaData. If the column's data type is defined as short, this value is returned.

(5) Exceptions

If the specified column value is 0 or less, or is greater than the number of columns in the table, the JDBC driver throws an SQLException.