code: protected final int doSelect(Connection c) throws SQLException {
  		Statement stmt = null;
  		ResultSet rs = null;
  		try {
  			stmt = c.createStatement();
  			rs = stmt.executeQuery("select * from foo");
  			int count = 0;
  			while (rs.next()) {
  				count++;
  			}
  			return count;
  		} finally {
  			if (rs != null) {
  				rs.close();
  			}
  			if (stmt != null) {
  				stmt.close();
  			}
  		}
  	}
docs: Executes select all records from table <i>foo</i>.
  
  @param c connection to DB
  @return record count
  @throws SQLException if something goes wrong