8.5.33 getFloat(int columnIndex)
- Organization of this subsection
(1) Function
This method acquires as float 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 float getFloat(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.
HADB data type |
Retrieval result |
Return value |
---|---|---|
CHAR VARCHAR |
Null value |
0.0 |
[space]integer-in-character-string-representation, decimal-number-in-character-string-representation, or floating-point-number-in-character-string-representation[space], and one of the following:
|
Retrieval result converted to a float value |
|
[space]integer-in-character-string-representation, decimal-number-in-character-string-representation, or floating-point-number-in-character-string-representation[space], and greater than Float.MAX_VALUE |
Infinity |
|
[space]integer-in-character-string-representation, decimal-number-in-character-string-representation, or floating-point-number-in-character-string-representation[space], and less than -Float.MAX_VALUE |
-Infinity |
|
[space]integer-in-character-string-representation, decimal-number-in-character-string-representation, or floating-point-number-in-character-string-representation[space], and less than Float.MIN_VALUE, and greater than 0 |
0.0 |
|
[space]integer-in-character-string-representation, decimal-number-in-character-string-representation, or floating-point-number-in-character-string-representation[space], and greater than -Float.MIN_VALUE, and less than 0 |
-0.0 |
|
[space]-Infinity[space] |
-Infinity |
|
[space][+]Infinity[space] |
Infinity |
|
[space][+|-]NaN[space] |
NaN |
|
Other than the above (cannot be converted to a float value) |
SQLException is thrown. |
|
SMALLINT |
Null value |
0.0 |
Other than the above |
Retrieval result converted to a float value |
|
INTEGER |
Null value |
0.0 |
Other than the above |
Retrieval result converted to a float value |
|
DECIMAL |
Null value |
0.0 |
Other than the above |
Retrieval result converted to a float value |
|
DOUBLE PRECISION |
Null value |
0.0 |
One of the following:
|
Retrieval result converted to a float value |
|
Greater than Float.MAX_VALUE |
Infinity |
|
Less than -Float.MAX_VALUE |
-Infinity |
|
Less than Float.MIN_VALUE and greater than 0 |
0.0 |
|
Greater than -Float.MIN_VALUE and less than 0 |
-0.0 |
|
BOOLEAN# |
Null value |
0.0 |
true |
1.0 |
|
false |
0.0 |
|
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:
-
This ResultSet object is closed.
This includes the case where the ResultSet object was closed because the Statement object that created this ResultSet object was closed.
-
The Connection used to create the Statement object that created this ResultSet object has been closed.
-
The ResultSet object has become invalid due to transaction settlement.
-
A nonexistent column number was specified.
-
The data type cannot be acquired by this method.
-
The column value cannot be acquired as float.
-
An error occurred in the JDBC driver.