Hitachi

Hitachi Advanced Database Application Development Guide


8.5.44 getObject(String columnLabel,Class<T> type)

Organization of this subsection

(1) Function

This method acquires the value in a specified column of the current row of a ResultSet object, and converts it to the Java data type of the specified class. The column whose value is to be acquired is specified in the argument of the method.

(2) Format

public synchronized <T> T getObject(String columnLabel,Class<T> type) throws SQLException

(3) Arguments

String columnLabel

Specifies the column name.

Class<T> type

Specifies the class that represents the Java data type after conversion. The value of the column specified by columnLabel is converted to the Java data type of the specified class.

Table 8‒31: Combinations of HADB data types and Java data types lists the conversions that are possible between data types. If you specify a combination that is not listed in Table 8‒31: Combinations of HADB data types and Java data types, an error occurs.

(4) Return value

The value in the column is returned as an object of the specified class. For details about the relationship between the retrieval result and the return value, see Table 8‒32: Relationship between retrieval results and return values (getObject method).

(5) Exceptions

For details about exceptions, see (5) Exceptions in 8.5.43 getObject(int columnIndex,Class<T> type).