Java SQL ResultSet Float Read getFloatOfNull(ResultSet rs, String columnName)

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

Description

get Float Of Null

License

Apache License

Declaration

public static Float getFloatOfNull(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 Float getFloatOfNull(ResultSet rs, String columnName) throws SQLException {
        float fVal = rs.getFloat(columnName);
        if (rs.wasNull()) {
            return null;
        }/*from w  w w  .j  a v a 2  s  . c o  m*/
        return new Float(fVal);
    }
}

Related

  1. getFloat(ResultSet resultSet, int columnIndex)
  2. getFloat(ResultSet resultSet, String columnName)
  3. getFloat(ResultSet rs, String colName)
  4. getFloat(ResultSet rs, String column)
  5. getFloatList(ResultSet resultSet, String columnName)
  6. getFloatValue(ResultSet resultSet, int columnIndex)