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 | Class and Description |
|---|---|
static class |
DatabaseRegistry.DatabaseVersion
Registration information for a particular 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.
|
boolean |
isLegacyVersion(java.lang.String type,
int version)
Tests whether the given database type/version is a legacy version in
the API.
|
java.util.Collection<java.lang.String> |
listDatabaseTypes()
Gets all the types of database that are registered with the API.
|
java.util.List<java.lang.Integer> |
listDatabaseVersions(java.lang.String type)
Gets all the versions for the given database type that are registered
with the API.
|
java.util.List<java.lang.Integer> |
listDatabaseVersions(java.lang.String type,
boolean incLegacy)
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)
|
void |
registerDatabases(java.lang.String type,
java.lang.String databaseCreatorClassName,
java.lang.ClassLoader classLoader,
ConnectionMatcher matcher,
DatabaseRegistry.DatabaseVersion... infos)
Registers the given connection creator with its classloader and all the
database versions that it supports.
|
@Deprecated
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)
public void registerDatabases(java.lang.String type,
java.lang.String databaseCreatorClassName,
java.lang.ClassLoader classLoader,
ConnectionMatcher matcher,
DatabaseRegistry.DatabaseVersion... infos)
type - the database typedatabaseCreatorClass - the DatabaseFactory.DatabaseCreator that
creates instances of the Database class, and also creates its
descriptor.classLoader - the ClassLoader for the class (can be null if the
class is in db-api or db-api-impl.matcher - the ConnectionMatcher used to identify whether a given
Connection could be of interest to the databaseCreatorClass.infos - the database version information that the connection
creator supports.public java.util.Collection<java.lang.String> listDatabaseTypes()
Database.getDatabaseType(),
DatabaseDescriptor.getDatabaseType()public java.util.List<java.lang.Integer> listDatabaseVersions(java.lang.String type)
type - the type of database to get the versions forlistDatabaseTypes(),
Database.getDatabaseVersion(),
DatabaseDescriptor.getDatabaseVersion()public java.util.List<java.lang.Integer> listDatabaseVersions(java.lang.String type,
boolean incLegacy)
type - the type of database to get the versions forincLegacy - whether to include legacy versionslistDatabaseTypes(),
Database.getDatabaseVersion(),
DatabaseDescriptor.getDatabaseVersion()public DatabaseDescriptor getDatabaseDescriptor(java.lang.String type, int version)
type - the database typeversion - the database versionpublic boolean isLegacyVersion(java.lang.String type,
int version)
type - the database type to testversion - the database version to testpublic java.lang.Class<? extends Database> loadDatabaseClass(java.lang.String clzName)
registerProviderClass for this to work.clzName - the name of the class to loadpublic java.lang.String getDatabaseName(java.lang.String type,
int ver)
type - the databse typever - the database versionpublic static DatabaseRegistry getInstance()