code: public int queryForInt(String sql) throws SQLException {
  		Number number = queryForObject(sql, Integer.class);
  		return (number != null ? number.intValue() : 0);
  	}
docs: Execute a query that returns a single int field.