コード例 #1
0
ファイル: SelectIterator.java プロジェクト: 601367322/banyou
 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);
   }
 }
コード例 #2
0
ファイル: SelectIterator.java プロジェクト: 601367322/banyou
 /** 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);
   }
 }