Java SQL ResultSet Int Read getIntFromResultSet(ResultSet rs, String field)

Here you can find the source of getIntFromResultSet(ResultSet rs, String field)

Description

get Int From Result Set

License

Apache License

Declaration

public static Integer getIntFromResultSet(ResultSet rs, String field) 

Method Source Code

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

import java.sql.ResultSet;

public class Main {
    public static Integer getIntFromResultSet(ResultSet rs, String field) {

        Integer result = null;//w ww .  j  a va  2s.c  o m

        try {
            Object value = rs.getObject(field);
            if (value != null) {
                result = (Integer) value;
            }
        } catch (Exception e) {
        }
        return result;
    }
}

Related

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