|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.DBObjectProviderFactory.Creator
oracle.javatools.db.DatabaseFactory
public final class DatabaseFactory
DatabaseFactory is a DBObjectProviderFactory.Creator implementation. It provides an extra ability to create new Connections for a given connection name. This provision requires a DatabaseFactory plugin that supports such an operation, by default the API does not contain one. The JDeveloper connection architecture provides such functionality and if used with jdeveloper this functionality will be available.
It is unlikely that the DatabaseFactory would be needed in the product. For the vast majority of cases, the oracle.jdeveloper.db.DatabaseConnections API (and associated classes) should be used.
Database
, DBObjectProviderFactory
Nested Class Summary | |
---|---|
static class |
DatabaseFactory.ConnectionCreator A connection creator should be registered for each connection store that exists. |
static class |
DatabaseFactory.DatabaseCreator Plugin to the DatabaseFactory for creating Databases and DatabaseDescriptors. |
Method Summary | ||
---|---|---|
static java.sql.Connection |
createConnection(Database db) This will return a new Connection for the given database if possible. |
|
static Database |
createDatabase(java.lang.String connName, DatabaseFactory.ConnectionCreator factory) Creates a Database using the given ConnectionCreator to create a connection for the given connection name. |
|
protected DBObjectProvider |
createProviderImpl(java.lang.Object identifier) Creates a provider for the given identifier if that identifier is a valid Database identifier. |
|
static Database |
createStandaloneDatabase(java.lang.String name, java.sql.Connection conn) Creates a standalone Database for the given Connection. |
|
static
|
findConnectionCreator(java.lang.Class<T> ccc) Looks for a registered connection creator of the given class. |
|
static DatabaseFactory.ConnectionCreator |
findConnectionCreator(Database db) Finds the connection creator (if one exists) that is responsible for this database instance. |
|
static Database |
findOrCreateDatabase(java.lang.String name, java.sql.Connection conn) Deprecated. - use createStandaloneDatabase(java.lang.String, java.sql.Connection) to create a Database for an isolated connection. If a Database is required for a given connection name in the product use the appropriate connection store (e.g. Application Connections, or central IDE Connections). |
|
protected DBObjectProvider |
findProvider(java.lang.Object identifier) |
|
static java.util.Collection<java.lang.Class<? extends Database>> |
getClasses() Gets the supported Database implementations from the API. |
|
static DatabaseDescriptor |
getDatabaseDescriptor(java.lang.Class providerClass) Returns a DatabaseDescriptor for the given provider class. |
|
static DatabaseDescriptor |
getDatabaseDescriptor(Database db) Returns a DatabaseDescriptor for the given database. |
|
static java.lang.String |
getDatabaseName(java.lang.Class<? extends Database> dbClz) Gets a translated string that describes the given database class to the nearest supported version. |
|
protected java.lang.String |
getIdentifier(DBObjectProvider provider) Returns an identifier for the given provider that is used when notifying listeners of provider events. |
|
static void |
registerConnectionCreator(DatabaseFactory.ConnectionCreator cc) Registers a Connection creator that can duplicate connections for the Databases provided by the factory. |
|
static void |
registerDatabaseCreator(DatabaseFactory.DatabaseCreator dc) Registers a Connection creator that can identify and create Databases and DatabaseDescriptors for the factory. |
|
protected DBObjectProvider |
uncacheProvider(java.lang.Object identifier) |
Methods inherited from class oracle.javatools.db.DBObjectProviderFactory.Creator |
---|
fireProviderDeleted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected java.lang.String getIdentifier(DBObjectProvider provider)
DBObjectProviderFactory.Creator
DBObjectProviderFactory.Creator.findProvider(java.lang.Object)
etc.getIdentifier
in class DBObjectProviderFactory.Creator
protected final DBObjectProvider createProviderImpl(java.lang.Object identifier) throws DBException
createProviderImpl
in class DBObjectProviderFactory.Creator
DBException
public static Database createDatabase(java.lang.String connName, DatabaseFactory.ConnectionCreator factory) throws DBException
DBException
protected DBObjectProvider findProvider(java.lang.Object identifier)
findProvider
in class DBObjectProviderFactory.Creator
protected DBObjectProvider uncacheProvider(java.lang.Object identifier)
uncacheProvider
in class DBObjectProviderFactory.Creator
@Deprecated
public static final Database findOrCreateDatabase(java.lang.String name,
java.sql.Connection conn)
throws DBException
createStandaloneDatabase(java.lang.String, java.sql.Connection)
to create a Database for an isolated connection. If a Database is required for a given connection name in the product use the appropriate connection store (e.g. Application Connections, or central IDE Connections).DBException
public static final Database createStandaloneDatabase(java.lang.String name, java.sql.Connection conn) throws DBException
name
- the name to give the Databaseconn
- the Connection to a databaseDBException
public static final DatabaseDescriptor getDatabaseDescriptor(java.lang.Class providerClass)
public static final DatabaseDescriptor getDatabaseDescriptor(Database db)
public static final void registerConnectionCreator(DatabaseFactory.ConnectionCreator cc)
public static final void registerDatabaseCreator(DatabaseFactory.DatabaseCreator dc)
public static final <T extends DatabaseFactory.ConnectionCreator> T findConnectionCreator(java.lang.Class<T> ccc)
ccc
- the ConnectionCreator subclass to look forpublic static final DatabaseFactory.ConnectionCreator findConnectionCreator(Database db)
public static final java.sql.Connection createConnection(Database db) throws DBException
This method is designed to create a duplicate Connection - the Database must have been setup with a Connection in the first place.
DBException
public static java.util.Collection<java.lang.Class<? extends Database>> getClasses()
getDatabaseName(java.lang.Class extends oracle.javatools.db.Database>
)
public static java.lang.String getDatabaseName(java.lang.Class<? extends Database> dbClz)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |