Java SQL ResultSet Double Read getDoubleValue(ResultSet resultSet, int columnIndex)

Here you can find the source of getDoubleValue(ResultSet resultSet, int columnIndex)

Description

Return any double value.

License

Apache License

Declaration

@SuppressWarnings("UnnecessaryBoxing")
public static Double getDoubleValue(ResultSet resultSet, int columnIndex) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    /**/*from  w  w w.  ja  v a  2 s.c  o  m*/
     * Return any double value.
     */
    @SuppressWarnings("UnnecessaryBoxing")
    public static Double getDoubleValue(ResultSet resultSet, int columnIndex) throws SQLException {
        double value = resultSet.getDouble(columnIndex);
        if (resultSet.wasNull()) {
            return null;
        }
        return Double.valueOf(value);
    }

    /**
     * Return any double value.
     */
    @SuppressWarnings("UnnecessaryBoxing")
    public static Double getDoubleValue(ResultSet resultSet, String columnName) throws SQLException {
        double value = resultSet.getDouble(columnName);
        if (resultSet.wasNull()) {
            return null;
        }
        return Double.valueOf(value);
    }
}

Related

  1. getDouble2(ResultSet rs, int index)
  2. getDoubleList(ResultSet resultSet, String columnName)
  3. getDoubleNotZero(ResultSet rs, String columnLabel)
  4. getDoubleOrNanFromResultSet(ResultSet rs, int index)
  5. getDoubleOrNull(ResultSet rs, String columnName)
  6. readDouble(ResultSet resultSet, String columnName)
  7. readDoubleFromResultSet(ResultSet rs, String column)