|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cle.persistence.ConnectionProvider | +--oracle.clex.persistence.jndi.JndiObjectProvider | +--oracle.clex.persistence.datasource.DataSourceProvider
DatasourceContextProvider calls getConnection()
on a datasource
whose jndi name is specified by the jndiname property. Returns a
java.sql.Connection
When used in J2EE (primary intent), only need to specify the
jndiname
in the properties. Other properties should be
specified in data-sources.xml on the J2EE server.
<?xml version="1.0" standalone="yes"?> <!DOCTYPE cle-providers SYSTEM "http://xmlns.oracle.com/ias/mvc/cle-providers.dtd"> <cle-providers> <provider name="personnel_ds" class="oracle.clex.persistence.ds.DataSourceProvider"> <property name="jndiname" value="jdbc/OracleDS"/> <property name="persistencebase" value="oracle.demo.personnel.persistence.ds"/> <property name="failover" value=""/> </provider> </cle-providers>
NOTE: If username and password are specified, then the
DataSource.getConnection(username, password)
method
will be used instead of the default DataSource.getConnection()
method.
Field Summary | |
protected java.util.Hashtable |
cache
This is here to support releasing a Connection via the releaseConnection method. |
Fields inherited from class oracle.clex.persistence.jndi.JndiObjectProvider |
jndiName, JNDINAME, jndiObject, NON_SSL_LOGIN |
Fields inherited from class oracle.cle.persistence.ConnectionProvider |
BASE64, connection, connectionString, CONNECTIONSTRING, defaultProperties, deploymentKey, driverType, DRIVERTYPE, encryptionType, ENCRYPTIONTYPE, failover, FAILOVER, host, HOST, NO_SCOPE, NONE, password, PASSWORD, persistenceBase, PERSISTENCEBASE, port, PORT, releasedConnectionIds, REQUEST_SCOPE, scope, SCOPE, SESSION_SCOPE, sessionConnectionIds, sid, SID, USER, userName |
Constructor Summary | |
DataSourceProvider()
|
|
DataSourceProvider(java.util.Properties properties)
|
Method Summary | |
protected void |
addPropertyKeys()
Each subclass should overload or override this method to include all the properties that it will use. |
protected java.lang.String |
getCacheKey(java.lang.Object sessionId)
This method is used in getConnection and releaseConnection to get a unique id for the cache |
java.lang.Object |
getConnection(java.lang.Object sessionId)
Returns a Connection from the datasource. |
java.lang.Object |
getConnection(java.lang.Object sessionId,
int failover)
Does nothing... |
javax.naming.Context |
getInitialContext()
Get an IntitialContext so that we can find the DataSource. |
boolean |
isConnected()
Returns the state of the connection for the Provider |
void |
releaseConnection(java.lang.Object sessionId)
Release the connection associated to the sessionId. |
Methods inherited from class oracle.clex.persistence.jndi.JndiObjectProvider |
applyDynamicProperties, connect, disconnect, findJndiObject, getJndiName, hashCode, isSame, setJndiName |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable cache
Constructor Detail |
public DataSourceProvider()
public DataSourceProvider(java.util.Properties properties)
Method Detail |
protected void addPropertyKeys()
addPropertyKeys
in class JndiObjectProvider
public java.lang.Object getConnection(java.lang.Object sessionId)
Connection
from the datasource.getConnection
in class JndiObjectProvider
public java.lang.Object getConnection(java.lang.Object sessionId, int failover)
getConnection
in class JndiObjectProvider
public void releaseConnection(java.lang.Object sessionId)
releaseConnection
in class ConnectionProvider
public boolean isConnected()
public javax.naming.Context getInitialContext() throws javax.naming.NamingException, java.lang.Exception
getInitialContext
in class JndiObjectProvider
protected java.lang.String getCacheKey(java.lang.Object sessionId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |