public void execute(QueryHandler qh) throws SQLException {
      try {
        int set = 1;
        boolean has_result = sql.execute();
        int update_count;

        while (true) {
          ResultSet result;

          if (has_result) {
            update_count = -1;
            result = sql.getResultSet();
          } else {
            update_count = sql.getUpdateCount();

            if (update_count == -1) {
              break;
            }

            result = sql.getGeneratedKeys();
          }

          qh.handleResult(set, update_count, result);
          ++set;

          has_result = sql.getMoreResults();
        }
      } finally {
        sql.clearParameters();
      }
    }
    public void bindParams(QueryHandler qh) throws SQLException {
      int p = 1;

      for (String param : params) {
        sql.setObject(p, qh.resolveParam(param));
        ++p;
      }
    }