Java Utililty Methods SQL ResultSet Double Read

List of utility methods to do SQL ResultSet Double Read

Description

The list of methods to do SQL ResultSet Double Read are organized into topic(s).

Method

DoublegetDouble(ResultSet res, String name)
Returns the values of the specified column as a Double.
double v = res.getDouble(name);
return res.wasNull() ? null : v;
DoublegetDouble(ResultSet resultSet, int columnIndex)
get Double
double value = resultSet.getDouble(columnIndex);
return resultSet.wasNull() ? null : value;
DoublegetDouble(ResultSet resultSet, String columnName)
Returns a double value using a given SQL result set and column name.
Double value = null;
if (resultSet != null && columnName != null) {
    double columnValue = resultSet.getDouble(columnName);
    if (!resultSet.wasNull()) {
        value = new Double(columnValue);
return value;
...
doublegetDouble(ResultSet rs, int index)
get Double
if (rs.getObject(index) != null) {
    return rs.getDouble(index);
throw new RuntimeException("Null value in non-Nullable column");
DoublegetDouble(ResultSet rs, String colName)
get Double
double res = rs.getDouble(colName);
return rs.wasNull() ? null : new Double(res);
doublegetDouble(ResultSet rs, String column)
get a double from ResultSet rs with name 'column' /** get a short from ResultSet rs with name 'column'
double i = rs.getDouble(column);
if (rs.wasNull())
    i = 0;
return i;
DoublegetDouble(ResultSet rs, String columnName)
get a Double from a result set column with given name
double val = rs.getDouble(columnName);
if (rs.wasNull()) {
    return null;
return val;
doublegetDouble2(ResultSet rs, int index)
get Double
Double result = rs.getDouble(index);
if (result == 0 && rs.getObject(index) == null) {
    throw new RuntimeException("Null value in non-Nullable column");
return result;
ListgetDoubleList(ResultSet resultSet, String columnName)
Returns a list of double values using a given SQL result set and column name.
List<Double> values = null;
if (resultSet != null && columnName != null) {
    values = new ArrayList<Double>();
    while (resultSet.next()) {
        values.add(getDouble(resultSet, columnName));
return values;
...
DoublegetDoubleNotZero(ResultSet rs, String columnLabel)
get Double Not Zero
return nullIfZero(getDouble(rs, columnLabel));