public static void select( DbConnection conn, String tblName, String colName, String qual, boolean distinct, IeciTdShortDecimalArrayList vals) throws Exception { DbSelectStatement stmt = null; try { stmt = new DbSelectStatement(); /* String sql = */ stmt.create(conn, tblName, colName, qual, distinct); stmt.execute(); while (stmt.next()) { vals.add(stmt.getShortDecimal(1)); } stmt.release(); } catch (Exception e) { DbSelectStatement.ensureRelease(stmt, e); } }
public static float selectShortDecimal( DbConnection conn, String tblName, String colName, String qual) throws Exception { float val = DbDataType.NULL_SHORT_DECIMAL; DbSelectStatement stmt = null; try { stmt = new DbSelectStatement(); /* String sql = */ stmt.create(conn, tblName, colName, qual, false); stmt.execute(); if (stmt.next()) { val = stmt.getShortDecimal(1); stmt.release(); return val; } else throw new IeciTdException(DbError.EC_NOT_FOUND, DbError.EM_NOT_FOUND); } catch (Exception e) { DbSelectStatement.ensureRelease(stmt, e); throw e; } }