Exemplo n.º 1
0
 public void close() throws SQLException {
   if (!closed) {
     compiledStmt.close();
     closed = true;
     last = null;
     if (statement != null) {
       logger.debug("closed iterator @{} after {} rows", hashCode(), rowC);
     }
     connectionSource.releaseConnection(connection);
   }
 }
Exemplo n.º 2
0
 /** If the statement parameter is null then this won't log information */
 public SelectIterator(
     Class<?> dataClass,
     Dao<T, ID> classDao,
     GenericRowMapper<T> rowMapper,
     ConnectionSource connectionSource,
     DatabaseConnection connection,
     CompiledStatement compiledStmt,
     String statement,
     ObjectCache objectCache)
     throws SQLException {
   this.dataClass = dataClass;
   this.classDao = classDao;
   this.rowMapper = rowMapper;
   this.connectionSource = connectionSource;
   this.connection = connection;
   this.compiledStmt = compiledStmt;
   this.results = compiledStmt.runQuery(objectCache);
   this.statement = statement;
   if (statement != null) {
     logger.debug("starting iterator @{} for '{}'", hashCode(), statement);
   }
 }