|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--TemporaryDatabase.Table
Temporary (in memory) database tables.
| Field Summary | |
protected Object[] |
currentrow
|
protected TableData |
data
|
protected int |
nrows
|
protected boolean |
readonly
|
protected int |
rowid
|
| Constructor Summary | |
Table(TableData data,
boolean readonly)
|
|
| Method Summary | |
boolean |
absolute(Object id)
Move to an absolute rowid in the table. |
void |
addColumn(String name,
int type,
int maxlen)
Add a new column to the table. |
void |
addRow()
Add a new row to the database. |
void |
afterLast()
Moves the table cursor to a position after the last row in the table. |
void |
beforeFirst()
Moves the table cursor to a position before the first row in the table. |
void |
close()
In some cases, it is desirable to immediately release a DatabaseTable's database and other resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release. |
void |
commitUpdates()
ModSQL will always call this method after performing a series of updateObject() calls on a particular row. |
void |
deleteRow()
Delete the current row from the table and the underlying database. |
protected void |
finalize()
|
int |
findColumn(String name)
Map a DatabaseTable column name to a DatabaseTable column index. |
int |
getColumnCount()
What's the number of columns in the DatabaseTable? |
int |
getColumnDisplaySize(int column)
What's the column's normal max width in chars? If the column type is not a string, or the maximum size is not known, this method may return -1. |
String |
getColumnLabel(int column)
What's the suggested column title for use in printouts and displays? In many cases this method should return the same value as getColumnName() below. |
String |
getColumnName(int column)
What's a column's name? |
int |
getColumnType(int column)
What's a column's SQL type? |
Object |
getObject(int column)
Get the value of a column in the current row as a Java object. |
long |
getRowCount()
This method is expected to return the total number of rows in the database. |
Object |
getRowId()
Get database specific rowid value. |
String |
getTableName()
What's the table's name? |
long |
getTableSignature()
Calculates a unique signature for this table. |
long |
getTableSize()
Returns the size of the table in bytes. |
boolean |
isAfterLast()
Determine if the table cursor is positioned after the last row in the table. |
boolean |
isBeforeFirst()
Determine if the table cursor is positioned before the first row in the table. |
boolean |
isIndexAvailable(int column)
Determines if an index is available for the specified column. |
boolean |
isReadOnly()
Is table read-only (ie. |
boolean |
next()
A DatabaseTable is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc. |
DatabaseIndex |
openIndex(int column)
Returns an index on the specified column. |
void |
updateObject(int column,
Object x)
Update a column with an Object value. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected TableData data
protected boolean readonly
protected int nrows
protected int rowid
protected Object[] currentrow
| Constructor Detail |
public Table(TableData data,
boolean readonly)
| Method Detail |
public void close()
DatabaseTableBaseIn some cases, it is desirable to immediately release a DatabaseTable's database and other resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release.
Note: A DatabaseTable is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results. A DatabaseTable is also automatically closed when it is garbage collected.
close in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occursprotected void finalize()
finalize in class Objectpublic DatabaseIndex openIndex(int column)
DatabaseTableopenIndex in interface DatabaseTableModSQL.DatabaseTablecolumn - index of column to be indexedDatabaseException - if a database-access error occurspublic boolean isIndexAvailable(int column)
DatabaseTableisIndexAvailable in interface DatabaseTableModSQL.DatabaseTablecolumn - index of column to be indexedDatabaseException - if a database-access error occurspublic boolean isReadOnly()
DatabaseTableisReadOnly in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurspublic String getTableName()
DatabaseTablegetTableName in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurspublic int getColumnCount()
DatabaseTablegetColumnCount in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurspublic long getTableSize()
DatabaseTablegetTableSize in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurspublic long getTableSignature()
DatabaseTableCalculates a unique signature for this table.
The signature should depend on values of:
Any change to the table that would invalidate an index should also change the signature. If this table will never be indexed, this method may return 0.
getTableSignature in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurspublic long getRowCount()
DatabaseTableBasegetRowCount in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic int findColumn(String name)
DatabaseTablefindColumn in interface DatabaseTableModSQL.DatabaseTablecolumnName - the name of the columnDatabaseException - if a database-access error occurs
public int getColumnDisplaySize(int column)
throws DatabaseException
DatabaseTablegetColumnDisplaySize in interface DatabaseTableModSQL.DatabaseTablecolumn - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurspublic String getColumnName(int column)
DatabaseTablegetColumnName in interface DatabaseTableModSQL.DatabaseTablecolumn - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurspublic String getColumnLabel(int column)
DatabaseTablegetColumnLabel in interface DatabaseTableModSQL.DatabaseTablecolumn - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurs
public int getColumnType(int column)
throws DatabaseException
DatabaseTablegetColumnType in interface DatabaseTableModSQL.DatabaseTablecolumn - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occursTypes
public void addColumn(String name,
int type,
int maxlen)
throws DatabaseException
DatabaseTableaddColumn in interface DatabaseTableModSQL.DatabaseTablename - column nametype - SQL typemaxlen - length of data (varying columns only)DatabaseException - if a database-access error occursTypespublic boolean next()
DatabaseTableBasenext in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurs
public void addRow()
throws DatabaseException
DatabaseTableaddRow in interface DatabaseTableModSQL.DatabaseTableDatabaseException - if a database-access error occurs
public void deleteRow()
throws DatabaseException
DatabaseTableBasedeleteRow in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic boolean isBeforeFirst()
DatabaseTableBaseisBeforeFirst in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic boolean isAfterLast()
DatabaseTableBaseisAfterLast in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic void beforeFirst()
DatabaseTableBasebeforeFirst in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic void afterLast()
DatabaseTableBaseafterLast in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic Object getRowId()
DatabaseTableBasegetRowId in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic boolean absolute(Object id)
DatabaseTableabsolute in interface DatabaseTableModSQL.DatabaseTablerowid - id of row to seekDatabaseException - if a database-access error occurs
public Object getObject(int column)
throws DatabaseException
DatabaseTableBaseGet the value of a column in the current row as a Java object.
This method will return the value of the given column as a Java object. The type of the Java object will be the default Java Object type corresponding to the column's SQL type, following the mapping specified in the JDBC spec.
This method may also be used to read datatabase specific abstract data types.
getObject in interface DatabaseTableBaseModSQL.DatabaseTableBasecolumn - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurs
public void updateObject(int column,
Object x)
throws DatabaseException
DatabaseTableBaseUpdate a column with an Object value.
The updateObject() method is used to update column values in the current row, or a newly inserted row.
updateObject in interface DatabaseTableBaseModSQL.DatabaseTableBasecolumn - the first column is 1, the second is 2, ...x - the new column valueDatabaseException - if a database-access error occurs
public void commitUpdates()
throws DatabaseException
DatabaseTableBasecommitUpdates in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||