oracle.jdbc.pool
Class OraclePooledConnection

java.lang.Object
  |
  +--oracle.jdbc.pool.OraclePooledConnection
Direct Known Subclasses:
OracleXAConnection

public class OraclePooledConnection
extends java.lang.Object
implements javax.sql.PooledConnection

An OraclePooledConnection object is a connection object that provides hooks for connection pool management. A PooledConnection object represents a physical connection to a data source. It implements javax.sql.PooledConnection


Constructor Summary
OraclePooledConnection()
           
OraclePooledConnection(java.sql.Connection pc)
           Create a Pooled Connection.
OraclePooledConnection(java.sql.Connection pc, boolean ac)
           Create a Pooled Connection.
OraclePooledConnection(java.lang.String url)
           Creates a PooledConnection.
OraclePooledConnection(java.lang.String url, java.lang.String user, java.lang.String passwd)
           Creates a PooledConnection.
 
Method Summary
 void addConnectionEventListener(javax.sql.ConnectionEventListener cel)
           Add an event listener.
 void close()
          Close the physical connection.
 java.sql.Connection getConnection()
          Create an object handle for this physical connection.
 int getStmtCacheSize()
          Return the size of Statement Cache.
 void removeConnectionEventListener(javax.sql.ConnectionEventListener cel)
           Remove an event listener.
 void setStmtCacheSize(int size)
          Set the statement cache size.
 void setStmtCacheSize(int size, boolean clearMetaData)
          Set the statement cache size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OraclePooledConnection

public OraclePooledConnection()

OraclePooledConnection

public OraclePooledConnection(java.lang.String url)
                       throws java.sql.SQLException

Creates a PooledConnection.

Parameters:
URL - of the physical connection.

OraclePooledConnection

public OraclePooledConnection(java.lang.String url,
                              java.lang.String user,
                              java.lang.String passwd)
                       throws java.sql.SQLException

Creates a PooledConnection.

Parameters:
URL - of the physical connection.
User - Name
Password -  

OraclePooledConnection

public OraclePooledConnection(java.sql.Connection pc)

Create a Pooled Connection.

Parameters:
The - corresponding physical connection.

OraclePooledConnection

public OraclePooledConnection(java.sql.Connection pc,
                              boolean ac)

Create a Pooled Connection.

Parameters:
The - corresponding physical connection
m_autoCommit - value
Method Detail

addConnectionEventListener

public void addConnectionEventListener(javax.sql.ConnectionEventListener cel)

Add an event listener.

Specified by:
addConnectionEventListener in interface javax.sql.PooledConnection
Parameters:
The - listener to be added

close

public void close()
           throws java.sql.SQLException

Close the physical connection.

Specified by:
close in interface javax.sql.PooledConnection
Throws:
java.sql.SQLException - if a database-access error occurs.

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException

Create an object handle for this physical connection. The object returned is a temporary handle used by application code to refer to a physical connection that is being pooled.

Specified by:
getConnection in interface javax.sql.PooledConnection
Returns:
a Connection object
Throws:
java.sql.SQLException - if a database-access error occurs.

removeConnectionEventListener

public void removeConnectionEventListener(javax.sql.ConnectionEventListener cel)

Remove an event listener.

Specified by:
removeConnectionEventListener in interface javax.sql.PooledConnection
Parameters:
The - listener to be removed.

setStmtCacheSize

public void setStmtCacheSize(int size)
                      throws java.sql.SQLException
Set the statement cache size. Default is 0. You cannot call this for logicalhandles obtained from PooledConnections.

If more than size cursors are already cached than they will be closed. By default the meta data of the cursor will be saved. Only data and the state will be cleared. You need to call this first to enable either type of Statement caching. When both types of Statement caching are enabled, the size is the total number of cursors cached for both the schemes together.

Parameters:
size - Size of the Cache
Throws:
java.sql.SQLException -  

setStmtCacheSize

public void setStmtCacheSize(int size,
                             boolean clearMetaData)
                      throws java.sql.SQLException
Set the statement cache size. Default is 0. You cannot call this for logicalhandles obtained from PooledConnections.

If more than size cursors are already cached than they will be closed. By default, the meta data of the cursor will be saved. But if clearMetaData is set to true, even that will be cleared. You need to call this first to enable either type of Statement caching. When both types of Statement caching are enabled, the size is the total number of cursors cached for both the schemes together.

Parameters:
size - Size of the Cache
clearMetaData - Whether the state has to be cleared or not
Throws:
java.sql.SQLException -  

getStmtCacheSize

public int getStmtCacheSize()
Return the size of Statement Cache.
Returns:
int Size of Statement Cache. If not set, the default 0 is returned.