Пример #1
0
  /**
   * Cancels the running query.
   *
   * @return <code>true</code> if and only if there is a running query and it has been canceled.
   * @throws JRException
   */
  public synchronized boolean cancelRunningQuery() throws JRException {
    if (queryExecuter != null) {
      return queryExecuter.cancelQuery();
    }

    return false;
  }
Пример #2
0
  protected void closeDatasource() {
    if (queryExecuter != null) {
      if (log.isDebugEnabled()) {
        log.debug("Fill " + filler.fillerId + ": closing query executer");
      }

      queryExecuter.close();
      queryExecuter = null;
    }

    reset();
  }
Пример #3
0
  /**
   * Creates the data source from a connection.
   *
   * @return the data source to be used
   * @throws JRException
   */
  private JRDataSource createQueryDatasource() throws JRException {
    if (query == null) {
      return null;
    }

    try {
      if (log.isDebugEnabled()) {
        log.debug(
            "Fill " + filler.fillerId + ": Creating " + query.getLanguage() + " query executer");
      }

      JRQueryExecuterFactory queryExecuterFactory =
          JRQueryExecuterUtils.getQueryExecuterFactory(query.getLanguage());
      queryExecuter = queryExecuterFactory.createQueryExecuter(parent, parametersMap);
      filler.fillContext.setRunningQueryExecuter(queryExecuter);

      return queryExecuter.createDatasource();
    } finally {
      filler.fillContext.clearRunningQueryExecuter();
    }
  }