Here you can find the source of getFirstInt(ResultSet resultSet)
public static int getFirstInt(ResultSet resultSet) throws SQLException
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; public class Main { /**/* www . ja v a2s .co m*/ * Returns int value of very first column in result set. */ public static int getFirstInt(ResultSet resultSet) throws SQLException { if (resultSet.next() == true) { return resultSet.getInt(1); } return -1; } }