code: public static int firstInt(PreparedStatement stmt) throws SQLException {
  		ResultSet rs = stmt.executeQuery();
  		int i = rs.next() ? rs.getInt(1) : Integer.MIN_VALUE;
  		stmt.close();
  		return i;
  	}
docs: Execute the query, get the int value in the first row and column of the result set, and close
  the statement.
  
  @param stmt
  must already have parameters set
  @return {@link Integer#MIN_VALUE} if the result set is empty