|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface to be implemented by database managers.
To create a new type of database, you need to implement both this interface and the DatabaseTable interface. The primary role of the DatabaseManager is to create DatabaseTable objects when given a table name.
DatabaseTable| Method Summary | |
boolean |
createIndex(String tablename,
String columnname)
Create an index of the specified column in the specified table (if capable). |
DatabaseTable |
createTable(String tablename,
boolean temporary)
Create a new table. |
boolean |
dropIndex(String tablename,
String columnname)
Drop an index. |
void |
dropTable(String tablename)
Drop a table. |
Function |
getFunction(String name)
Get a database specific function for use in SQL. |
int |
getMajorVersion()
Get the driver's major version number. |
int |
getMinorVersion()
Get the driver's minor version number. |
boolean |
hasTable(String tablename)
Checks whether this database has the specified table. |
DatabaseTable |
openTable(String tablename)
Opens the database table with the specified name for read only access. |
DatabaseTable |
openTable(String tablename,
boolean readonly)
Opens the database table with the specified name with read only or read write access. |
| Method Detail |
public int getMajorVersion()
public int getMinorVersion()
public boolean hasTable(String tablename)
throws DatabaseException
tablename - name of the tableDatabaseException - if a database-access error occurs
public DatabaseTable openTable(String tablename)
throws DatabaseException
tablename - name of the table to openDatabaseException - if a database-access error occurs
public DatabaseTable openTable(String tablename,
boolean readonly)
throws DatabaseException
tablename - name of the table to openreadonly - true to open table read onlyDatabaseException - if a database-access error occurs
public DatabaseTable createTable(String tablename,
boolean temporary)
throws DatabaseException
tablename - name of the table to createtemporary - table is temporaryDatabaseException - if a database-access error occurs
public boolean createIndex(String tablename,
String columnname)
throws DatabaseException
tablename - name of the table to indexcolumnname - name of the column to indexDatabaseException - if a database-access error occurs
public void dropTable(String tablename)
throws DatabaseException
tablename - name of the table to dropDatabaseException - if a database-access error occurs
public boolean dropIndex(String tablename,
String columnname)
throws DatabaseException
tablename - name of the table with indexcolumnname - name of the column with indexDatabaseException - if a database-access error occurs
public Function getFunction(String name)
throws DatabaseException
Get a database specific function for use in SQL. This function may be used in any SQL query (not just queries involving this database's tables). Note that when looking up function names, ModSQL will always check for database specific functions before using built-in functions, so this method may be used to override the built-in SQL functions.
This method should return null if a function by the specified name is not found.
name - name of function to lookup (always lowercase)DatabaseException - if a database-access error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||