|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.MetaManager
DatabaseManager that can be used to combine multiple DatabaseManagers into one metadatabase.
This implementation of DatabaseManager allows other classes implementing DatabaseManager to register themselves. When this object is asked for a particular DatabaseTable, the MetaManager searches its list of DatabaseManager's for one that can provide the required table.
| Field Summary | |
private static Vector |
managers
Array of database managers. |
| Constructor Summary | |
MetaManager()
Constructor. |
|
| Method Summary | |
boolean |
createIndex(String name,
String column)
Create an index of the specified column in the specified table (if capable). |
DatabaseTable |
createTable(String name,
boolean temporary)
Create a new table using the first manager that will host it. |
boolean |
dropIndex(String name,
String column)
Drop an index. |
void |
dropTable(String name)
Drop a table. |
Function |
getFunction(String name)
Get a database specific function for use in SQL. |
int |
getMajorVersion()
Major version number. |
static DatabaseManager[] |
getManagers()
Get current list of database managers. |
int |
getMinorVersion()
Minor version number. |
boolean |
hasTable(String name)
Check all managers for the specified table. |
DatabaseTable |
openTable(String name)
Open table (read-only) using the first manager that provides the table. |
DatabaseTable |
openTable(String name,
boolean readonly)
Open table using the first manager that provides the table. |
static void |
registerManager(DatabaseManager manager)
Register a database manager with the meta-manager. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static Vector managers
| Constructor Detail |
public MetaManager()
| Method Detail |
public static void registerManager(DatabaseManager manager)
manager - DatabaseManager to registerpublic static DatabaseManager[] getManagers()
public int getMajorVersion()
getMajorVersion in interface DatabaseManagerpublic int getMinorVersion()
getMinorVersion in interface DatabaseManager
public boolean hasTable(String name)
throws DatabaseException
hasTable in interface DatabaseManagername - table to search forDatabaseException - if a database-access error occurs
public DatabaseTable openTable(String name)
throws DatabaseException
openTable in interface DatabaseManagername - table to search forDatabaseException - if a database-access error occurs
public DatabaseTable openTable(String name,
boolean readonly)
throws DatabaseException
openTable in interface DatabaseManagername - table to search forreadonly - true for read-only, false for read-writeDatabaseException - if a database-access error occurs
public DatabaseTable createTable(String name,
boolean temporary)
throws DatabaseException
createTable in interface DatabaseManagername - table to createtemporary - true if the table is temporaryDatabaseException - if a database-access error occurs
public boolean createIndex(String name,
String column)
throws DatabaseException
createIndex in interface DatabaseManagertablename - name of the table to indexcolumnname - name of the column to indexDatabaseException - if a database-access error occurs
public void dropTable(String name)
throws DatabaseException
dropTable in interface DatabaseManagertablename - name of the table to dropDatabaseException - if a database-access error occurs
public boolean dropIndex(String name,
String column)
throws DatabaseException
dropIndex in interface DatabaseManagertablename - 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
getFunction in interface DatabaseManagername - 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 | ||||||||