|
|||||||||
| Home >> All >> javatools >> [ db overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javatools.db
Class DbTable

java.lang.Objectjavatools.db.AbstractTable
javatools.db.DbAbstractTable
javatools.db.DbTable
- All Implemented Interfaces:
- DbResult, DbTableUser
- Direct Known Subclasses:
- DbCachedTable, DbReferencedTable
- public class DbTable
- extends DbAbstractTable
- implements DbResult
- extends DbAbstractTable
A class representing tabular data. Could be a real database table or the result of a SELECT.
- Version:
- 0.2.0
| Field Summary | |
(package private) int |
columnCount
|
(package private) java.util.List |
columns
Contains the list of columns. |
protected DbDatabase |
db
The database used for the connection. |
(package private) java.lang.Object[] |
defaultValues
Contains the default values for this table. |
(package private) java.sql.ResultSet |
rs
The real result set. |
(package private) java.sql.PreparedStatement |
stmt
The statement that generated the result set. |
| Fields inherited from class javatools.db.AbstractTable |
colNameMap, 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. |
(package private) DbColumn |
getAddColumn()
Adds a column and returns it to the caller. |
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, inserter, inserter, simpleDeleter, simpleInserter, simpleInserter, simpleUpdater, updater |
| Methods inherited from class javatools.db.AbstractTable |
equals, getColumnIndex, getColumnName, setColumnCount, setColumnName, usesTables |
| Methods inherited from class java.lang.Object |
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
columnCount
int columnCount
rs
java.sql.ResultSet rs
- The real result set.
stmt
java.sql.PreparedStatement stmt
- The statement that generated the result set.
columns
java.util.List columns
- Contains the list of columns.
defaultValues
java.lang.Object[] defaultValues
- Contains the default values for this table.
db
protected DbDatabase db
- The database used for the connection.
| Constructor Detail |
DbTable
public DbTable(DbDatabase db) throws DbException
- Creates a new DbTable.
| Method Detail |
setResultSet
public void setResultSet(java.sql.PreparedStatement stmt, java.sql.ResultSet rs) throws DbException
- Sets the result set to take rows from.
setTableName
public void setTableName(java.lang.String v)
- Sets the table name.
- Overrides:
setTableNamein classAbstractTable
getColumn
public DbColumn getColumn(java.lang.String name) throws DbException
- Get the DbColumn representing the column with this name.
- Specified by:
getColumnin classDbAbstractTable
getColumn
public DbColumn getColumn(int index) throws DbException
- Get the column of the given index. Index is a zero based array.
- Specified by:
getColumnin classDbAbstractTable
getColumnCount
public int getColumnCount()
- Returns the number of columns.
- Overrides:
getColumnCountin classAbstractTable
getDatabase
public DbDatabase getDatabase()
- Get the database that this table came fr
- Overrides:
getDatabasein classDbAbstractTable
getFullTableName
public java.lang.String getFullTableName()
- Returns the complete table name.
- Overrides:
getFullTableNamein classAbstractTable
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.
close
public void close()
throws DbException
getConstraint
public DbConstraint getConstraint()
- Returns null (no constraint in a simple DbTable).
- Specified by:
getConstraintin classDbAbstractTable
getDefault
public java.lang.Object getDefault(int index) throws DbException
- Returns the default value for this table.
- Specified by:
getDefaultin classDbAbstractTable
getDefault
public java.lang.Object getDefault(java.lang.String name) throws DbException
- Returns the default value of a column.
- Specified by:
getDefaultin classDbAbstractTable
finalize
protected void finalize()
throws java.lang.Throwable
- Destroys this object.
getAddColumn
DbColumn getAddColumn() throws DbException
- Adds a column and returns it to the caller.
|
|||||||||
| Home >> All >> javatools >> [ db overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC