|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface to be implemented by classes representing database tables.
To create a new type of database, you need to implement DatabaseTable and DatabaseManager. DatabaseManager creates DatabaseTable objects.
DatabaseManager| Method Summary | |
boolean |
absolute(Object rowid)
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. |
int |
findColumn(String columnName)
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? |
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 |
isIndexAvailable(int column)
Determines if an index is available for the specified column. |
boolean |
isReadOnly()
Is table read-only (ie. |
DatabaseIndex |
openIndex(int column)
Returns an index on the specified column. |
| Methods inherited from interface ModSQL.DatabaseTableBase |
afterLast, beforeFirst, close, commitUpdates, deleteRow, getObject, getRowCount, getRowId, isAfterLast, isBeforeFirst, next, updateObject |
| Method Detail |
public DatabaseIndex openIndex(int column)
throws DatabaseException
column - index of column to be indexedDatabaseException - if a database-access error occurs
public boolean isIndexAvailable(int column)
throws DatabaseException
column - index of column to be indexedDatabaseException - if a database-access error occurs
public boolean isReadOnly()
throws DatabaseException
DatabaseException - if a database-access error occurs
public String getTableName()
throws DatabaseException
DatabaseException - if a database-access error occurs
public int getColumnCount()
throws DatabaseException
DatabaseException - if a database-access error occurs
public long getTableSize()
throws DatabaseException
DatabaseException - if a database-access error occurs
public long getTableSignature()
throws DatabaseException
Calculates 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.
DatabaseException - if a database-access error occurs
public int findColumn(String columnName)
throws DatabaseException
columnName - the name of the columnDatabaseException - if a database-access error occurs
public int getColumnDisplaySize(int column)
throws DatabaseException
column - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurs
public String getColumnLabel(int column)
throws DatabaseException
column - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurs
public String getColumnName(int column)
throws DatabaseException
column - the first column is 1, the second is 2, ...DatabaseException - if a database-access error occurs
public int getColumnType(int column)
throws DatabaseException
column - 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
name - column nametype - SQL typemaxlen - length of data (varying columns only)DatabaseException - if a database-access error occursTypes
public void addRow()
throws DatabaseException
DatabaseException - if a database-access error occurs
public boolean absolute(Object rowid)
throws DatabaseException
rowid - id of row to seekDatabaseException - if a database-access error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||