示例#1
0
  public static void select(
      DbConnection conn,
      String tblName,
      String colName,
      String qual,
      String withQuery,
      boolean distinct,
      IeciTdShortTextArrayList vals)
      throws Exception {

    DbSelectStatement stmt = null;

    try {

      stmt = new DbSelectStatement();
      /* String sql = */ stmt.create(conn, withQuery, tblName, colName, qual, distinct);
      stmt.execute();

      while (stmt.next()) {
        vals.add(stmt.getShortText(1));
      }

      stmt.release();

    } catch (Exception e) {
      DbSelectStatement.ensureRelease(stmt, e);
    }
  }
示例#2
0
  public static String selectShortText(
      DbConnection conn, String tblName, String colName, String qual) throws Exception {

    String val = DbDataType.NULL_SHORT_TEXT;
    DbSelectStatement stmt = null;

    try {

      stmt = new DbSelectStatement();
      /* String sql = */ stmt.create(conn, tblName, colName, qual, false);
      stmt.execute();

      if (stmt.next()) {
        val = stmt.getShortText(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;
    }
  }