Java SQL ResultSet Int Read getIntFromResultSet(ResultSet rset, Enum field)

Here you can find the source of getIntFromResultSet(ResultSet rset, Enum field)

Description

get Int From Result Set

License

Open Source License

Declaration

public static int getIntFromResultSet(ResultSet rset, Enum field) throws SQLException 

Method Source Code

//package com.java2s;
/**/*from   ww  w  .  ja  v  a2  s  .c  om*/
 Copyright (c) 2013, Amit Lieberman
All rights reserved.
    
           GNU LESSER GENERAL PUBLIC LICENSE
               Version 3, 29 June 2007
    
 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
    
    
  This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License
    
 * Created with love
 * User: shpandrak
 * Date: 10/20/12
 * Time: 10:37
 */

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

public class Main {
    public static int getIntFromResultSet(ResultSet rset, Enum field) throws SQLException {
        return getIntFromResultSet(rset, field.name());
    }

    public static int getIntFromResultSet(ResultSet rset, String field) throws SQLException {
        return rset.getInt(field);
    }

    public static int getIntFromResultSet(ResultSet rset, int fieldIndex) throws SQLException {
        return rset.getInt(fieldIndex);
    }
}

Related

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