Java SQL ResultSet Read getFirstInt(ResultSet resultSet)

Here you can find the source of getFirstInt(ResultSet resultSet)

Description

Returns int value of very first column in result set.

License

Open Source License

Declaration

public static int getFirstInt(ResultSet resultSet) throws SQLException 

Method Source Code


//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;
    }
}

Related

  1. getExpectedType(ResultSet resultSet, int columnIndex)
  2. getExplainPlan(ResultSet rs)
  3. getFieldNames(ResultSet rs)
  4. getFieldsPresentInResultSet(ResultSet rs)
  5. getFirstGeometryFieldIndex(ResultSet resultSet)
  6. getFlags(ResultSet rs)
  7. getGeneratedIdFromResultSet(ResultSet resultSet)
  8. getHashMap(ResultSet resultSet)
  9. getHeaders(ResultSetMetaData rsmd)