Java 类com.hp.hpl.jena.query.QueryCancelledException 实例源码

项目:r2rml-kit    文件:SQLIterator.java   
public boolean hasNext() {
    if (cancelled) {
        throw new QueryCancelledException();
    }
    if (explicitlyClosed) {
        return false;
    }
    if (prefetchedRow == null) {
        ensureQueryExecuted();
        tryFetchNextRow();
    }
    return prefetchedRow != null;
}
项目:r2rml-kit    文件:SQLIterator.java   
private void ensureQueryExecuted() {
  if (this.queryExecuted) {
    return;
  }
    this.queryExecuted = true;
    log.info(sql);
     try {
Connection con = this.database.connection();
this.statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
if (database.fetchSize() != Database.NO_FETCH_SIZE) {
    try {
        this.statement.setFetchSize(database.fetchSize());
    }
    catch (SQLException e) {} /* Some drivers don't support fetch sizes, e.g. JDBC-ODBC */
}

database.vendor().beforeExecuteQuery(con);
this.resultSet = this.statement.executeQuery(this.sql);
database.vendor().afterExecuteQuery(con);

log.debug("SQL result set created");
     } catch (SQLException ex) {
        if (cancelled) {
            log.debug("SQL query execution cancelled", ex);
            throw new QueryCancelledException();
        }
        throw new D2RQException(ex.getMessage() + ": " + this.sql);
     }
 }
项目:c4a_data_repository    文件:SQLIterator.java   
public boolean hasNext() {
    if (cancelled) {
        throw new QueryCancelledException();
    }
    if (explicitlyClosed) {
        return false;
    }
    if (prefetchedRow == null) {
        ensureQueryExecuted();
        tryFetchNextRow();
    }
    return prefetchedRow != null;
}
项目:c4a_data_repository    文件:SQLIterator.java   
private void ensureQueryExecuted() {
  if (this.queryExecuted) {
    return;
  }
    this.queryExecuted = true;
    log.info(sql);
    BeanCounter.totalNumberOfExecutedSQLQueries++;
     try {
Connection con = this.database.connection();
this.statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
if (database.fetchSize() != Database.NO_FETCH_SIZE) {
    try {
        this.statement.setFetchSize(database.fetchSize());
    }
    catch (SQLException e) {} /* Some drivers don't support fetch sizes, e.g. JDBC-ODBC */
}
this.resultSet = this.statement.executeQuery(this.sql);
log.debug("SQL result set created");
this.numCols = this.resultSet.getMetaData().getColumnCount();
     } catch (SQLException ex) {
        if (cancelled) {
            log.debug("SQL query execution cancelled", ex);
            throw new QueryCancelledException();
        }
        throw new D2RQException(ex.getMessage() + ": " + this.sql);
     }
 }
项目:OpenCollegeGraph    文件:SQLIterator.java   
public boolean hasNext() {
    if (cancelled) {
        throw new QueryCancelledException();
    }
    if (explicitlyClosed) {
        return false;
    }
    if (prefetchedRow == null) {
        ensureQueryExecuted();
        tryFetchNextRow();
    }
    return prefetchedRow != null;
}
项目:OpenCollegeGraph    文件:SQLIterator.java   
private void ensureQueryExecuted() {
  if (this.queryExecuted) {
    return;
  }
    this.queryExecuted = true;
    log.info(sql);
    BeanCounter.totalNumberOfExecutedSQLQueries++;
     try {
Connection con = this.database.connection();
this.statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
if (database.fetchSize() != Database.NO_FETCH_SIZE) {
    try {
        this.statement.setFetchSize(database.fetchSize());
    }
    catch (SQLException e) {} /* Some drivers don't support fetch sizes, e.g. JDBC-ODBC */
}
this.resultSet = this.statement.executeQuery(this.sql);
log.debug("SQL result set created");
this.numCols = this.resultSet.getMetaData().getColumnCount();
     } catch (SQLException ex) {
        if (cancelled) {
            log.debug("SQL query execution cancelled", ex);
            throw new QueryCancelledException();
        }
        throw new D2RQException(ex.getMessage() + ": " + this.sql);
     }
 }
项目:cqels    文件:MappingIteratorBase.java   
@Override
public Mapping nextMapping() {
    try {
        if (abortIterator) {
            throw new QueryCancelledException();
        }
        if (finished) {
            // If abortIterator set after finished.
            if (abortIterator) {
                throw new QueryCancelledException();
            }
            throw new NoSuchElementException(Utils.className(this));
        }

        if (!hasNextMapping()) {
            throw new NoSuchElementException(Utils.className(this));
        }

        Mapping obj = moveToNextMapping();
        if (obj == null) {
            throw new NoSuchElementException(Utils.className(this));
        }
        if (requestingCancel && !finished) {
            // But .cancel sets both requestingCancel and abortIterator
            // This only happens with a continuing iterator.
            close();
        }

        return obj;
    } catch (QueryFatalException ex) {
        Log.fatal(this, "QueryFatalException", ex);
        //abort ? 
        throw ex;
    }
}
项目:VirtualSPARQLer    文件:SQLIterator.java   
public boolean hasNext() {
    if (cancelled) {
        throw new QueryCancelledException();
    }
    if (explicitlyClosed) {
        return false;
    }
    if (prefetchedRow == null) {
        ensureQueryExecuted();
        tryFetchNextRow();
    }
    return prefetchedRow != null;
}
项目:VirtualSPARQLer    文件:SQLIterator.java   
private void ensureQueryExecuted() {
  if (this.queryExecuted) {
    return;
  }
    this.queryExecuted = true;
    log.info(sql);
    BeanCounter.totalNumberOfExecutedSQLQueries++;
     try {
Connection con = this.database.connection();
this.statement = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
if (database.fetchSize() != Database.NO_FETCH_SIZE) {
    try {
        this.statement.setFetchSize(database.fetchSize());
    }
    catch (SQLException e) {} /* Some drivers don't support fetch sizes, e.g. JDBC-ODBC */
}
this.resultSet = this.statement.executeQuery(this.sql);
log.debug("SQL result set created");
this.numCols = this.resultSet.getMetaData().getColumnCount();
     } catch (SQLException ex) {
        if (cancelled) {
            log.debug("SQL query execution cancelled", ex);
            throw new QueryCancelledException();
        }
        throw new D2RQException(ex.getMessage() + ": " + this.sql);
     }
 }