|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.0.0) E17493-01 |
|||||||||
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.ConnectionCreatorFactory
Provide ConnectionCreatorFactory implementations to provide ConnectionCreators for different stores in the product. |
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 java.lang.String[] |
decodeIdentifier(java.lang.String id)
Decodes the store name and connection name from the given encoded identifier. |
|
static java.lang.String |
encodeIdentifier(java.lang.String storeName,
java.lang.String connName)
Encodes the given store name and connection name into a valid factory identifier. |
|
static
|
findConnectionCreator(java.lang.Class<T> ccc)
Deprecated. |
|
static DatabaseFactory.ConnectionCreator |
findConnectionCreator(Database db)
Deprecated. |
|
static DatabaseFactory.ConnectionCreator |
findConnectionCreator(java.lang.String storeName)
|
|
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). |
|
static Database |
findOrCreateDatabase(java.lang.String storeName,
java.lang.String connName)
Utility method that calls DBObjectProvider.findOrCreateProvider with the correcty provider type for Databases, and a fully qualified name encoded from the given store name and connection name. |
|
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 |
getDescription(java.lang.Object identifier)
Gets a displayable string to represent the database with the given identifier. |
|
protected java.lang.String |
getIdentifier(DBObjectProvider provider)
Returns an identifier for the given provider that is used when notifying listeners of provider events. |
|
java.lang.String |
getProviderType()
This method must return a String unique to the Creator that identifies the type of DBObjectProvider that will be created. |
|
static void |
registerConnectionCreator(java.lang.String storeName,
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. |
|
static void |
registerProviderClass(java.lang.Class<? extends Database> clz,
java.lang.String name)
Registers the given provider class with its translated name. |
|
static void |
setJdbcDatabaseCreator(DatabaseFactory.DatabaseCreator dc)
Sets the database creator for generic JDBC implmentations (i.e. |
|
protected DBObjectProvider |
uncacheProvider(java.lang.Object identifier)
|
|
static void |
unregisterConnectionCreator(java.lang.String storeName,
DatabaseFactory.ConnectionCreator cc)
|
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 |
---|
public java.lang.String getProviderType()
DBObjectProviderFactory.Creator
getProviderType
in class DBObjectProviderFactory.Creator
protected java.lang.String getDescription(java.lang.Object identifier)
DBObjectProviderFactory.Creator
getDescription
in class DBObjectProviderFactory.Creator
public static java.lang.String[] decodeIdentifier(java.lang.String id)
encodeIdentifier
.
encodeIdentifier(String,String)
public static java.lang.String encodeIdentifier(java.lang.String storeName, java.lang.String connName)
decodeIdentifier(String)
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
public static final Database findOrCreateDatabase(java.lang.String storeName, java.lang.String connName) throws DBException
storeName
- the connection store the database connection is inconnName
- the name of the connection within the store
DBException
- if the connection details are found but a connection
to the database cannot be established.@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 database
DBException
public static final DatabaseDescriptor getDatabaseDescriptor(java.lang.Class providerClass)
public static void setJdbcDatabaseCreator(DatabaseFactory.DatabaseCreator dc)
dc
- the DatabaseCreator for JDBC databases.public static final DatabaseDescriptor getDatabaseDescriptor(Database db)
public static final void registerConnectionCreator(java.lang.String storeName, DatabaseFactory.ConnectionCreator cc)
public static final void unregisterConnectionCreator(java.lang.String storeName, DatabaseFactory.ConnectionCreator cc)
public static final void registerDatabaseCreator(DatabaseFactory.DatabaseCreator dc)
public static DatabaseFactory.ConnectionCreator findConnectionCreator(java.lang.String storeName)
@Deprecated public static final <T extends DatabaseFactory.ConnectionCreator> T findConnectionCreator(java.lang.Class<T> ccc)
@Deprecated public 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 void registerProviderClass(java.lang.Class<? extends Database> clz, java.lang.String name)
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 11g Release 2 (11.1.2.0.0) E17493-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |