Java SQL ResultSet Int Read getIntegerValue(ResultSet resultSet, String columnName)

Here you can find the source of getIntegerValue(ResultSet resultSet, String columnName)

Description

Return any integer value.

License

Apache License

Declaration

@SuppressWarnings("UnnecessaryBoxing")
public static Integer getIntegerValue(ResultSet resultSet, 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 {
    /**/*from  w  ww  .j ava2s .c  o  m*/
     * Return any integer value.
     */
    @SuppressWarnings("UnnecessaryBoxing")
    public static Integer getIntegerValue(ResultSet resultSet, String columnName) throws SQLException {
        int value = resultSet.getInt(columnName);
        if (resultSet.wasNull()) {
            return null;
        }
        return Integer.valueOf(value);
    }
}

Related

  1. getInteger(ResultSet s, int idx)
  2. getIntegerFromResultSet(ResultSet rs, String db_name)
  3. getIntegerList(ResultSet resultSet, String columnName)
  4. getIntegerNotZeroNotMinValue(ResultSet rs, String columnLabel)
  5. getIntegers(ResultSet rs, String column)
  6. getIntegerValue(ResultSet rs, int columnIndex)
  7. getIntFromResultSet(ResultSet rs, String field)
  8. getIntFromResultSet(ResultSet rset, Enum field)
  9. readIntegerFromResultSet(ResultSet rs, String column)