public final class DatabaseRegistry
extends java.lang.Object
Use the registerDatabase(java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.ClassLoader) method to register a new database version.
| Modifier and Type | Method and Description | 
|---|---|
DatabaseDescriptor | 
getDatabaseDescriptor(java.lang.String type, int version)
Gets the DatabaseDescriptor for the given type and version. 
 | 
java.lang.String | 
getDatabaseName(java.lang.String type, int ver)
Gets a translated string that describes the given database class name to the nearest supported version. 
 | 
static DatabaseRegistry | 
getInstance()
Gets the single registry instance. 
 | 
java.util.Collection<java.lang.String> | 
listDatabaseTypes()
Gets all the types of database that are registered with the API. 
 | 
java.util.Collection<java.lang.Integer> | 
listDatabaseVersions(java.lang.String type)
Gets all the versions for the given database type that are registered with the API. 
 | 
java.lang.Class<? extends Database> | 
loadDatabaseClass(java.lang.String clzName)
Attempts to load the given database class name. 
 | 
void | 
registerDatabase(java.lang.String type, int version, java.lang.String nlsName, java.lang.String databaseImplName, java.lang.String databaseCreatorClassName, java.lang.ClassLoader classLoader)
Registers the given provider class with its classloader and translated name. 
 | 
public void registerDatabase(java.lang.String type,
                    int version,
                    java.lang.String nlsName,
                    java.lang.String databaseImplName,
                    java.lang.String databaseCreatorClassName,
                    java.lang.ClassLoader classLoader)
type - the database typeversion - the database versionnlsName - the translated name of the datbase version that can be displayed to the user.className - the name of the class to registerdatabaseCreatorClass - the DatabaseFactory.DatabaseCreator that creates instances of the Database class, and also creates its descriptor.loader - the ClassLoader for the class (can be null if the class is in db-api or db-api-impl.public java.util.Collection<java.lang.String> listDatabaseTypes()
Database.getDatabaseType(), DatabaseDescriptor.getDatabaseType()public java.util.Collection<java.lang.Integer> listDatabaseVersions(java.lang.String type)
type - the type of database to get the versions for.listDatabaseTypes(), Database.getDatabaseVersion(), DatabaseDescriptor.getDatabaseVersion()public DatabaseDescriptor getDatabaseDescriptor(java.lang.String type, int version)
type - the database typeversion - the database versionpublic java.lang.Class<? extends Database> loadDatabaseClass(java.lang.String clzName)
registerProviderClass for this to work.clzName - the name of the class to load
public java.lang.String getDatabaseName(java.lang.String type,
                               int ver)
type - the databse typever - the database versionpublic static DatabaseRegistry getInstance()