Hitachi

Hitachi Advanced Database Application Development Guide


8.8.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‒77: Character strings returned when the getColumnClassName method is executed

Column's data type (HADB data type)

Character string returned

BIGINT

"java.lang.Long"

INTEGER#1

"java.lang.Integer"

SMALLINT#2

"java.lang.Short"

DOUBLE PRECISION, FLOAT

"java.lang.Double"

REAL

"java.lang.Float"

DECIMAL, NUMERIC

"java.math.BigDecimal"

CHAR

"java.lang.String"

VARCHAR

"java.lang.String"

STRING

"java.lang.String"

DATE

"java.sql.Date"

TIME

"java.sql.Time"

TIMESTAMP WITHOUT TIME ZONE

"java.sql.Timestamp"

TIMESTAMP WITH TIME ZONE

"java.time.OffsetDateTime"

BINARY

"java.lang.Object"

VARBINARY

"java.lang.Object"

ROW

"java.lang.Object"

BOOLEAN

"java.lang.Boolean"

UUID

"java.util.UUID"

#1

If the integer data type format is in legacy format, "java.lang.Long" is returned.

#2

If the integer data type format is in legacy format, "java.lang.Integer" 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.