Here you can find the source of getNumRows(ResultSet query)
public static int getNumRows(ResultSet query)
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static int getNumRows(ResultSet query) { int numRows = 0; try {/*from ww w . j av a 2 s. co m*/ if (query.last()) numRows = query.getRow(); } catch (SQLException e) { e.printStackTrace(); } return numRows; } }