Hitachi

Hitachi Advanced Database Application Development Guide


8.5.15 getBoolean(int columnIndex)

Organization of this subsection

(1) Function

This method acquires as boolean in the Java programming language 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 boolean getBoolean(int columnIndex) throws SQLException

(3) Arguments

int columnIndex

Specifies a column number.

(4) Return value

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

Table 8‒21: Relationship between the retrieval result and the return value (getBoolean method)

HADB data type

Retrieval result

Return value

CHAR

VARCHAR

Null value

false

[space]1[space]

true

Other than the above

false

SMALLINT

Null value

false

0

false

Other than the above

true

INTEGER

Null value

false

0

false

Other than the above

true

DECIMAL

Null value

false

0[.00...0]

false

Other than the above

true

DOUBLE PRECISION

Null value

false

0.0 or -0.0

false

Other than the above

true

BOOLEAN#

Null value

false

Non-null value

retrieval-result

Other

Not applicable

SQLException is thrown.

#

BOOLEAN-type data exists when the ResultSet object was created from DatabaseMetadata.

(5) Exceptions

The JDBC driver throws an SQLException in the following cases: