Hitachi

Hitachi Advanced Database Application Development Guide


8.5.51 getTime(int columnIndex)

Organization of this subsection

(1) Function

This method acquires in a java.sql.Time object the value in a specified column in the current row of the ResultSet object. The column whose value is to be acquired is specified in the argument.

(2) Format

public synchronized java.sql.Time getTime(int columnIndex) throws SQLException

(3) Arguments

int columnIndex

Specifies a column number.

(4) Return value

This method returns the column value. The following table shows the relationship between the retrieval result and the return value.

For details about the conversion for DATE, TIME, TIMESTAMP, or character string type (CHAR or VARCHAR), see (2) Data conversion process during execution of a getXXX method (for DATE, TIME, TIMESTAMP, or character string type) in 7.6.2 Data conversion process.

Table 8‒35: Relationship between the retrieval result and the return value (getTime method)

HADB data type

Retrieval result

Return value

CHAR

VARCHAR

Null value

null

[space] formatted-time#[space]

Retrieval result converted to a java.sql.Time object without the spaces at the beginning and end of the retrieval result

Other than the above

SQLException is thrown.

TIME

Null value

null

Other than the above

Retrieval result converted to a java.sql.Time object

TIMESTAMP

Null value

null

Other than the above

Retrieval result converted to a java.sql.Time object

Other

Not applicable

SQLException is thrown.

#

formatted-time is a character string in the time format 'hh:mm:ss[.f...]'.

(5) Exceptions

The JDBC driver throws an SQLException in the following cases: