Java SQL ResultSet Double Read getDoubleOrNull(ResultSet rs, String columnName)

Here you can find the source of getDoubleOrNull(ResultSet rs, String columnName)

Description

get Double Or Null

License

Apache License

Declaration

public static Double getDoubleOrNull(ResultSet rs, String columnName) throws SQLException 

Method Source Code


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

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

public class Main {
    public static Double getDoubleOrNull(ResultSet rs, String columnName) throws SQLException {
        double sVal = rs.getDouble(columnName);
        if (rs.wasNull()) {
            return null;
        }// w  w  w  .j  a  v a 2  s  .c  om
        return new Double(sVal);
    }
}

Related

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