|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javatools.db.DbAbstractTable | +--javatools.db.DbTable
A class representing tabular data. Could be a real database table or the result of a SELECT.
Field Summary |
Fields inherited from class javatools.db.DbAbstractTable |
db, displaySize, names, tableName, types |
Constructor Summary | |
DbTable(DbDatabase db)
Creates a new DbTable. |
Method Summary | |
void |
close()
Closes this table. |
protected void |
finalize()
Destroys this object. |
DbColumn |
getColumn(int index)
Get the column of the given index. |
DbColumn |
getColumn(java.lang.String name)
Get the DbColumn representing the column with this name. |
int |
getColumnCount()
Returns the number of columns. |
DbConstraint |
getConstraint()
Returns null (no constraint in a simple DbTable). |
DbDatabase |
getDatabase()
Get the database that this table came fr |
java.lang.Object |
getDefault(int index)
Returns the default value for this table. |
java.lang.Object |
getDefault(java.lang.String name)
Returns the default value of a column. |
java.lang.String |
getFullTableName()
Returns the complete table name. |
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 take rows from. |
void |
setTableName(java.lang.String v)
Sets the table name. |
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 |
Constructor Detail |
public DbTable(DbDatabase db) throws DbException
db
- The database to use.
DbException
- If something goes wrong.Method Detail |
public void setResultSet(java.sql.PreparedStatement stmt, java.sql.ResultSet rs) throws DbException
stmt
- The statement that generated the result set. It can be null.rs
- The result set to use.
DbException
- If something goes wrong.public void setTableName(java.lang.String v)
setTableName
in class DbAbstractTable
v
- The new table name.public DbColumn getColumn(java.lang.String name) throws DbException
getColumn
in class DbAbstractTable
name
- The name of the column.
DbException
- If something goes wrong.public DbColumn getColumn(int index) throws DbException
getColumn
in class DbAbstractTable
index
- The index of the column.
DbException
- If something goes wrong.public int getColumnCount()
getColumnCount
in class DbAbstractTable
public DbDatabase getDatabase()
getDatabase
in class DbAbstractTable
public java.lang.String getFullTableName()
getFullTableName
in class DbAbstractTable
public DbIterator iterator()
BUGS: Currently you can only iterate over a table that was returned from a DbSelector.
public void close() throws DbException
DbException
- If something goes wrong.public DbConstraint getConstraint()
getConstraint
in class DbAbstractTable
public java.lang.Object getDefault(int index) throws DbException
getDefault
in class DbAbstractTable
index
- The index of the requested column.
DbException
- If something goes wrong.public java.lang.Object getDefault(java.lang.String name) throws DbException
getDefault
in class DbAbstractTable
name
- The name of the column.
DbException
- If something goes wrong.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- If something goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |