public GearsResult(Database db, ResultSet results) { this.db = db; this.results = results; int count = results.getFieldCount(); for (int i = 0; i < count; ++i) { String field; try { field = results.getFieldName(i); map.put(field, i); } catch (Exception e) { ComponentLog.trace("Invalid field name in ResultSet"); } } }
public void dispose() { try { results.close(); } catch (Exception e) { ComponentLog.trace("Failed to close result set: " + e.toString()); } }
public void next() { results.next(); }
public boolean isValid() { boolean rtn = results.isValidRow(); return (rtn); }
public double asDouble(String key) throws Exception { return (results.getFieldAsDouble(field(key))); }
public int asInt(String key) throws Exception { return (results.getFieldAsInt(field(key))); }
public String asString(String key) throws Exception { return (results.getFieldAsString(field(key))); }