javatools.db
Class DbCachedTable

java.lang.Object
  |
  +--javatools.db.DbAbstractTable
        |
        +--javatools.db.DbTable
              |
              +--javatools.db.DbCachedTable
All Implemented Interfaces:
DbTableUser

public class DbCachedTable
extends DbTable

It's a "cached" table, that represents a result from SELECT in a cached way, that is it can be accessed more than once.


Field Summary
protected  java.util.LinkedList resultList
          Contains the result list as a linked list instead of a result set.
 
Fields inherited from class javatools.db.DbAbstractTable
db, displaySize, names, tableName, types
 
Constructor Summary
DbCachedTable(DbDatabase db)
          Creates new DbCachedTable
 
Method Summary
 DbIterator iterator()
          Return an iterator to iterate over the rows in this table.
 void setResultSet(java.sql.PreparedStatement stmt, java.sql.ResultSet rs)
          Sets the result set to be representend in this class.
 
Methods inherited from class javatools.db.DbTable
close, finalize, getColumn, getColumn, getColumnCount, getConstraint, getDatabase, getDefault, getDefault, getFullTableName, setTableName
 
Methods inherited from class javatools.db.DbAbstractTable
deleter, equals, inserter, inserter, simpleDeleter, simpleInserter, simpleInserter, simpleUpdater, updater, usesTables
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultList

protected java.util.LinkedList resultList
Contains the result list as a linked list instead of a result set.

Constructor Detail

DbCachedTable

public DbCachedTable(DbDatabase db)
              throws DbException
Creates new DbCachedTable

Parameters:
db - The database for this operation.
Throws:
DbException - If something goes wrong.
Method Detail

iterator

public DbIterator iterator()
Return an iterator to iterate over the rows in this table.

BUGS: Currently you can only iterate over a table that was returned from a DbSelector.

Overrides:
iterator in class DbTable
Returns:
The needed iterator.

setResultSet

public void setResultSet(java.sql.PreparedStatement stmt,
                         java.sql.ResultSet rs)
                  throws DbException
Sets the result set to be representend in this class.

Overrides:
setResultSet in class DbTable
Parameters:
stmt - The source statement of the result set. It can be null.
rs - The needed result set.
Throws:
DbException - If something goes wrong.