public class OraclePooledConnection extends java.lang.Object implements OraclePooledConnection, java.io.Serializable, oracle.jdbc.internal.Monitor, Diagnosable
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
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoCommit |
static java.lang.String |
close_callback_string |
int |
closeOption |
static java.lang.String |
connect_auto_commit_string |
static java.lang.String |
connection_properties_string |
static java.lang.String |
event_listener_string |
static java.lang.String |
explicit_caching_enabled |
static java.lang.String |
ExplicitStatementCachingEnabled |
static java.lang.String |
implicit_caching_enabled |
static java.lang.String |
ImplicitStatementCachingEnabled |
static java.lang.String |
isClearMetaData |
protected oracle.jdbc.internal.OracleConnection |
logicalHandle |
static java.lang.String |
LoginTimeout |
static java.lang.String |
NO_IMPLICIT_BEGIN_REQUEST_PROPERTY |
static java.lang.String |
object_type_map |
protected oracle.jdbc.driver.OracleDriver |
oracleDriver |
protected oracle.jdbc.internal.OracleConnection |
physicalConn |
static java.lang.String |
pool_auto_commit_string |
static java.lang.String |
private_data |
protected oracle.jdbc.internal.OracleConnection |
replayConn |
static java.lang.String |
sql_exception_string |
static java.lang.String |
statement_cache_size |
static java.lang.String |
transaction_isolation |
static java.lang.String |
url_string |
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(javax.sql.ConnectionEventListener cel)
Add an event listener.
|
void |
addStatementEventListener(javax.sql.StatementEventListener listener) |
void |
close()
Close the physical connection.
|
java.sql.CallableStatement |
getCallWithKey(java.lang.String key)
getCallWithKey
Searches the explicit cache for a match on key.
|
java.sql.Connection |
getConnection()
Create an object handle for this physical connection.
|
protected oracle.jdbc.internal.OracleConnection |
getConnectionDuringExceptionHandling() |
Diagnosable |
getDiagnosable() |
boolean |
getExplicitCachingEnabled()
getExplicitCachingEnabled
Returns true if the explicit cache is currently enabled, false otherwise.
|
boolean |
getImplicitCachingEnabled()
getImplicitCachingEnabled
Returns true if the implicit cache is currently enabled, false otherwise.
|
long |
getLastAccessedTime()
Deprecated.
|
java.sql.Connection |
getLogicalHandle()
Return the logical handle to the caller.
|
oracle.jdbc.internal.Monitor.CloseableLock |
getMonitorLock() |
java.sql.Connection |
getPhysicalHandle() |
int |
getStatementCacheSize()
getStatementCacheSize
Returns the current size of the application cache.
|
java.sql.PreparedStatement |
getStatementWithKey(java.lang.String key)
getStatementWithKey
Searches the explicit cache for a match on key.
|
int |
getStmtCacheSize()
Deprecated.
|
javax.transaction.xa.XAResource |
getXAResource()
Return an XA resource to the caller.
|
boolean |
isStatementCacheInitialized() |
void |
purgeExplicitCache()
purgeExplicitCache
Removes all existing statements from the explicit cache, after which it
will be empty.
|
void |
purgeImplicitCache()
purgeImplicitCache
Removes all existing statements from the implicit cache, after which it
will be empty.
|
void |
registerImplicitCacheConnectionEventListener(javax.sql.ConnectionEventListener cel)
Deprecated.
|
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener cel)
Remove an event listener.
|
void |
removeStatementEventListener(javax.sql.StatementEventListener listener) |
void |
setConnection(oracle.jdbc.internal.OracleConnection rconn) |
void |
setExplicitCachingEnabled(boolean cache)
setExplicitCachingEnabled
Enables or disables the explicit cache.
|
void |
setImplicitCachingEnabled(boolean cache)
setImplicitCachingEnabled
Enables or disables the implicit cache.
|
void |
setLastAccessedTime(long lastAccessedTime)
Deprecated.
|
void |
setProperties(java.util.Hashtable prop) |
void |
setShardingKey(OracleShardingKey shardingKey,
OracleShardingKey superShardingKey)
Sets the sharding key and the super sharding key on this connection.
|
boolean |
setShardingKeyIfValid(OracleShardingKey shardingKey,
OracleShardingKey superShardingKey,
int timeout)
Checks the validity of the connection and also checks if the sharding keys
passed to this method are valid for the connection.If the sharding keys are
valid, it will be set on the connection's session.
|
void |
setStatementCacheSize(int size)
setStatementCacheSize
Specifies the size of the size of the application cache (which will be
used by both implicit and explicit caching).
|
void |
setStmtCacheSize(int size)
Deprecated.
|
void |
setStmtCacheSize(int size,
boolean clearMetaData)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacquireCloseableLock, acquireLock, assertLockHeldByCurrentThread, isReentrantLock, newDefaultLock, newInstance, releaseLockbegin, beginCurrentSql, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugp, end, endCurrentSql, format, isDebugEnabled, isDiagnoseFirstFailureEnabled, isLoggable, isSensitiveEnabled, onClose, propertyChange, resumeLogging, secure, suspendLogging, trace, traceppublic static final java.lang.String url_string
public static final java.lang.String pool_auto_commit_string
public static final java.lang.String object_type_map
public static final java.lang.String transaction_isolation
public static final java.lang.String statement_cache_size
public static final java.lang.String isClearMetaData
public static final java.lang.String ImplicitStatementCachingEnabled
public static final java.lang.String ExplicitStatementCachingEnabled
public static final java.lang.String LoginTimeout
public static final java.lang.String connect_auto_commit_string
public static final java.lang.String implicit_caching_enabled
public static final java.lang.String explicit_caching_enabled
public static final java.lang.String connection_properties_string
public static final java.lang.String event_listener_string
public static final java.lang.String sql_exception_string
public static final java.lang.String close_callback_string
public static final java.lang.String private_data
protected boolean autoCommit
protected transient oracle.jdbc.internal.OracleConnection logicalHandle
protected transient oracle.jdbc.internal.OracleConnection physicalConn
protected transient oracle.jdbc.internal.OracleConnection replayConn
public int closeOption
protected transient oracle.jdbc.driver.OracleDriver oracleDriver
public static final java.lang.String NO_IMPLICIT_BEGIN_REQUEST_PROPERTY
public OraclePooledConnection()
public OraclePooledConnection(java.lang.String url)
throws java.sql.SQLException
Creates a PooledConnection.
url - URL of the physical connection.java.sql.SQLExceptionpublic OraclePooledConnection(java.lang.String url,
java.lang.String user,
java.lang.String passwd)
throws java.sql.SQLException
Creates a PooledConnection.
url - URL of the physical connection.user - Usernamepasswd - Passwordjava.sql.SQLExceptionpublic OraclePooledConnection(java.sql.Connection pc)
Create a Pooled Connection.
pc - The corresponding physical connection.public OraclePooledConnection(java.sql.Connection pc,
boolean ac)
Create a Pooled Connection.
pc - The corresponding physical connectionac - autoCommit valuepublic void addConnectionEventListener(javax.sql.ConnectionEventListener cel)
Add an event listener.
addConnectionEventListener in interface javax.sql.PooledConnectioncel - The listener to be addedpublic void close()
throws java.sql.SQLException
Close the physical connection.
close in interface javax.sql.PooledConnectionjava.sql.SQLException - if a database-access error occurs.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.
getConnection in interface javax.sql.PooledConnectionjava.sql.SQLException - if a database-access error occurs.public java.sql.Connection getLogicalHandle()
throws java.sql.SQLException
Return the logical handle to the caller. This logical handle refers to the physical connection that is pooled.
getLogicalHandle in interface OraclePooledConnectionjava.sql.SQLExceptionpublic java.sql.Connection getPhysicalHandle()
throws java.sql.SQLException
java.sql.SQLException@Deprecated
public void setLastAccessedTime(long lastAccessedTime)
throws java.sql.SQLException
setLastAccessedTime in interface OraclePooledConnectionjava.sql.SQLException@Deprecated
public long getLastAccessedTime()
throws java.sql.SQLException
getLastAccessedTime in interface OraclePooledConnectionjava.sql.SQLException@Deprecated public void registerImplicitCacheConnectionEventListener(javax.sql.ConnectionEventListener cel)
registerImplicitCacheConnectionEventListener in interface OraclePooledConnectionpublic void removeConnectionEventListener(javax.sql.ConnectionEventListener cel)
Remove an event listener.
removeConnectionEventListener in interface javax.sql.PooledConnectioncel - The listener to be removed.public void setStmtCacheSize(int size)
throws java.sql.SQLException
If more than
size - Size of the Cachejava.sql.SQLExceptionpublic void setStmtCacheSize(int size,
boolean clearMetaData)
throws java.sql.SQLException
If more than
size - Size of the CacheclearMetaData - Whether the state has to be cleared or notjava.sql.SQLExceptionpublic int getStmtCacheSize()
public void setStatementCacheSize(int size)
throws java.sql.SQLException
setStatementCacheSize in interface OraclePooledConnectionsize - Requested size of the cache. If the existing cache size
is less than size, statements will be purged to reduce the
size.java.sql.SQLException - if size < 0, or if called on a logical connection.public int getStatementCacheSize()
throws java.sql.SQLException
getStatementCacheSize in interface OraclePooledConnectionjava.sql.SQLExceptionpublic void setImplicitCachingEnabled(boolean cache)
throws java.sql.SQLException
setImplicitCachingEnabled in interface OraclePooledConnectioncache - If true, then implicit caching will be enabled. If false,
then any existing statements will be purged and the implicit
cache will be disabled.java.sql.SQLException - if called on a logical connection.public boolean getImplicitCachingEnabled()
throws java.sql.SQLException
getImplicitCachingEnabled in interface OraclePooledConnectionjava.sql.SQLExceptionpublic void setExplicitCachingEnabled(boolean cache)
throws java.sql.SQLException
setExplicitCachingEnabled in interface OraclePooledConnectioncache - If true, then explicit caching will be enabled. If false,
then any existing statements will be purged and the explicit
cache will be disabled.java.sql.SQLException - if called on a logical connection.public boolean getExplicitCachingEnabled()
throws java.sql.SQLException
getExplicitCachingEnabled in interface OraclePooledConnectionjava.sql.SQLExceptionpublic void purgeImplicitCache()
throws java.sql.SQLException
purgeImplicitCache in interface OraclePooledConnectionjava.sql.SQLExceptionpublic void purgeExplicitCache()
throws java.sql.SQLException
purgeExplicitCache in interface OraclePooledConnectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement getStatementWithKey(java.lang.String key)
throws java.sql.SQLException
getStatementWithKey in interface OraclePooledConnectionkey - Specified key to search forjava.sql.SQLExceptionpublic java.sql.CallableStatement getCallWithKey(java.lang.String key)
throws java.sql.SQLException
getCallWithKey in interface OraclePooledConnectionkey - Specified key to search forjava.sql.SQLExceptionpublic boolean isStatementCacheInitialized()
public final void setProperties(java.util.Hashtable prop)
public javax.transaction.xa.XAResource getXAResource()
throws java.sql.SQLException
getXAResource in interface OraclePooledConnectionjava.sql.SQLException - if a database error occurspublic void addStatementEventListener(javax.sql.StatementEventListener listener)
addStatementEventListener in interface javax.sql.PooledConnectionpublic void removeStatementEventListener(javax.sql.StatementEventListener listener)
removeStatementEventListener in interface javax.sql.PooledConnectionpublic void setConnection(oracle.jdbc.internal.OracleConnection rconn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean setShardingKeyIfValid(OracleShardingKey shardingKey, OracleShardingKey superShardingKey, int timeout) throws java.sql.SQLException
setShardingKeyIfValid in interface OraclePooledConnectionshardingKey - Sharding key to be validated against this connectionsuperShardingKey - Super Sharding key to be validated against this connectiontimeout - Time in seconds before which the validation process is expected to
be complete, else the validation process is aborted. The value of
the timeout must be set to zero to disable the timeout during the
validation.java.sql.SQLException - if there is any exception while performing this validation or if
timeout value is less than 0.public void setShardingKey(OracleShardingKey shardingKey, OracleShardingKey superShardingKey) throws java.sql.SQLException
setShardingKey in interface OraclePooledConnectionshardingKey - sharding key to be set on this connectionsuperShardingKey - Super Sharding key to be set on this connectionjava.sql.SQLException - if there is an exception while setting the sharding keys on this
connection.protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
public final oracle.jdbc.internal.Monitor.CloseableLock getMonitorLock()
getMonitorLock in interface oracle.jdbc.internal.Monitorpublic Diagnosable getDiagnosable()
getDiagnosable in interface Diagnosable