Skip navigation links
oracle.javatools.db
Class DatabaseFactory.ConnectionCreator
java.lang.Object
oracle.javatools.db.DatabaseFactory.ConnectionCreator
- Enclosing class:
- DatabaseFactory
-
public abstract static class DatabaseFactory.ConnectionCreator
- extends java.lang.Object
A connection creator should be registered for each connection store that exists. The connection store should be able to create new Connections given the name of a connection.
Field Summary |
protected java.util.Map<java.lang.String,Database> |
m_dbs
|
Method Summary |
protected void |
cacheDatabase(java.lang.String connName, Database db)
|
protected abstract java.sql.Connection |
createConnectionImpl(java.lang.String connName)
Creates a Connection from a registered connection store if a connection of given name exists. |
Database |
findDatabase(java.lang.String connName)
|
protected abstract java.lang.String |
getStoreName()
|
protected boolean |
isActive()
|
boolean |
renameDatabase(java.lang.String oldName, java.lang.String newName)
|
boolean |
shouldClearCaches(java.sql.Connection oldConn, java.sql.Connection newConn, Database db)
Called on reconnect to test whether a Database should clear its caches of objects and privileges before using the new conenction. |
Database |
uncacheDatabase(java.lang.String connName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_dbs
protected java.util.Map<java.lang.String,Database> m_dbs
DatabaseFactory.ConnectionCreator
public DatabaseFactory.ConnectionCreator()
createConnectionImpl
protected abstract java.sql.Connection createConnectionImpl(java.lang.String connName)
throws DBException
- Creates a Connection from a registered connection store if a connection of given name exists.
-
- Throws:
DBException
isActive
protected boolean isActive()
getStoreName
protected abstract java.lang.String getStoreName()
shouldClearCaches
public boolean shouldClearCaches(java.sql.Connection oldConn,
java.sql.Connection newConn,
Database db)
- Called on reconnect to test whether a Database should clear its caches of objects and privileges before using the new conenction.
-
- Parameters:
oldConn
- the old connection to compare - this should already be closed.
newConn
- the new connection to compare - this should have been created by createConnectionImpl(String)
to replace the closed oldConn.
db
- the Database that will have its caches cleared.
- Returns:
- true if the caches should be cleared (which is the default behaviour).
findDatabase
public Database findDatabase(java.lang.String connName)
uncacheDatabase
public Database uncacheDatabase(java.lang.String connName)
cacheDatabase
protected void cacheDatabase(java.lang.String connName,
Database db)
renameDatabase
public boolean renameDatabase(java.lang.String oldName,
java.lang.String newName)
Skip navigation links
Copyright © 1997, 2015, Oracle. All rights reserved.