oracle.clex.persistence.jdbc
Class JDBCPoolProvider

java.lang.Object
  |
  +--oracle.cle.persistence.ConnectionProvider
        |
        +--oracle.clex.persistence.jdbc.JDBCPoolProvider
All Implemented Interfaces:
Connectable, java.io.Serializable
Direct Known Subclasses:
OracleJDBCPoolProvider

public abstract class JDBCPoolProvider
extends ConnectionProvider

Creates a JDBC connection pool.

JDBCPoolProvider returns logical java.sql.Connection instances from the javax.sql.PooledConection. When the class loads, it creates a single physical connection to the database per deployment key.

See Also:
Serialized Form

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
JDBCPoolProvider(java.util.Properties properties)
          Default Constructor
 
Method Summary
 void connect()
          Connect to the database using its own provider info.
 void disconnect()
          Disconnect Provider from the database
 java.lang.Object getConnection(java.lang.Object sessionId)
          Returns a logical Connection object from the PooledConnection
 java.lang.Object getConnection(java.lang.Object sessionId, int failover)
          Does nothing.
abstract  javax.sql.PooledConnection getPoolConnection()
          Create and get a vendor specific PooledConnection instance using the connectionstring.
protected  java.lang.String getPoolKey(java.lang.Object sessionId)
          This method is used in getConnection and releaseConnection to get a unique id for the pool
 int hashCode()
          Override Object.hashCode() so that we can differentiate JDBCConnection copies in the ConnectionPool.
 boolean isConnected()
          Returns the state of the PooledConnection for the Provider
 boolean isSame(ConnectionProvider provider)
          Compares this JDBCConnection info and returns true if their values are the same...
 void releaseConnection(java.lang.Object sessionId)
          Release the Connection associated with the sessionId.
 
Methods inherited from class oracle.cle.persistence.ConnectionProvider
addPropertyKey, addPropertyKeys, applyDynamicProperties, clone, compareDynamicProperties, compareProperty, equals, getConnection, getConnection, getConnection, getConnection, getConnection, getConnection, getConnectionString, getDefaultProperties, getDeploymentKey, getDriverType, getEncryptionType, getFailOver, getHost, getPassword, getPassword, getPersistenceBase, getPort, getProperty, getPropertyKeys, getScope, getSid, getUnspecifiedKeys, getUserName, issueWarnings, releaseAllConnections, releaseAllConnections, releaseConnection, releaseConnection, releaseConnection, releaseRequestScopedConnections, releaseRequestScopedConnections, removePropertyKey, setConnectionString, setDefaultProperties, setDeploymentKey, setEncryptionType, setHost, setPassword, setPersistenceBase, setPort, setScope, setSid, setUserName, warn
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCPoolProvider

public JDBCPoolProvider(java.util.Properties properties)
Default Constructor
Method Detail

hashCode

public int hashCode()
Override Object.hashCode() so that we can differentiate JDBCConnection copies in the ConnectionPool. Uses the String class' hashCode method because the mere mortals who wrote this method didn't want to be bothered by writing it
Overrides:
hashCode in class ConnectionProvider
Following copied from class: oracle.cle.persistence.ConnectionProvider
See Also:
Object

isSame

public boolean isSame(ConnectionProvider provider)
Compares this JDBCConnection info and returns true if their values are the same... false otherwise. Returns false when projectName is different
Overrides:
isSame in class ConnectionProvider

getPoolConnection

public abstract javax.sql.PooledConnection getPoolConnection()
Create and get a vendor specific PooledConnection instance using the connectionstring.

connect

public void connect()
Connect to the database using its own provider info.

NOTE: This connect method uses the single string argument version of the DriverManager.getConnection(String connectionString) method. Therefore, you MUST specifiy the username and password for the connection in the property file for any JDBC Connections.


disconnect

public void disconnect()
Disconnect Provider from the database

isConnected

public boolean isConnected()
Returns the state of the PooledConnection for the Provider

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId)
                               throws java.lang.Exception
Returns a logical Connection object from the PooledConnection
Overrides:
getConnection in class ConnectionProvider

getPoolKey

protected java.lang.String getPoolKey(java.lang.Object sessionId)
This method is used in getConnection and releaseConnection to get a unique id for the pool

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId,
                                      int failover)
Does nothing. Returns null
Overrides:
getConnection in class ConnectionProvider

releaseConnection

public void releaseConnection(java.lang.Object sessionId)
Description copied from class: ConnectionProvider
Release the Connection associated with the sessionId. Applications should NOT invoke this method.
Overrides:
releaseConnection in class ConnectionProvider


Copyright © 2003 ORACLE Corp. All Rights Reserved.