|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdbc.pool.OraclePooledConnection
public class OraclePooledConnection
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
Field Summary | |
---|---|
static java.lang.String |
BUILD_DATE |
java.util.Properties |
cachedConnectionAttributes |
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 |
static java.lang.String |
LoginTimeout |
static java.lang.String |
object_type_map |
static java.lang.String |
pool_auto_commit_string |
static java.lang.String |
private_data |
static boolean |
PRIVATE_TRACE |
static java.lang.String |
sql_exception_string |
static java.lang.String |
statement_cache_size |
static boolean |
TRACE |
static java.lang.String |
transaction_isolation |
java.util.Properties |
unMatchedCachedConnAttr |
static java.lang.String |
url_string |
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.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. |
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() Get the last accessed time on the PooledConnection. |
java.sql.Connection |
getLogicalHandle() Return the logical handle to the caller. |
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) Register an event listener for the implicit connection cache. |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener cel) Remove an event listener. |
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) Set the last accessed time on the PooledConnection. |
void |
setProperties(java.util.Hashtable prop) |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.sql.PooledConnection |
---|
addStatementEventListener, removeStatementEventListener |
Field Detail |
---|
public 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
public java.util.Properties cachedConnectionAttributes
public java.util.Properties unMatchedCachedConnAttr
public int closeOption
public static final java.lang.String BUILD_DATE
public static final boolean TRACE
public static final boolean PRIVATE_TRACE
Constructor Detail |
---|
public OraclePooledConnection()
public OraclePooledConnection(java.lang.String url) throws java.sql.SQLException
Creates a PooledConnection.
url
- URL of the physical connection.java.sql.SQLException
public 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
- User Namepasswd
- Passwordjava.sql.SQLException
public 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 valueMethod Detail |
---|
public void addConnectionEventListener(javax.sql.ConnectionEventListener cel)
Add an event listener.
addConnectionEventListener
in interface javax.sql.PooledConnection
cel
- The listener to be addedpublic void close() throws java.sql.SQLException
Close the physical connection.
close
in interface javax.sql.PooledConnection
java.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.PooledConnection
java.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.
java.sql.SQLException
public java.sql.Connection getPhysicalHandle() throws java.sql.SQLException
java.sql.SQLException
public void setLastAccessedTime(long lastAccessedTime) throws java.sql.SQLException
Set the last accessed time on the PooledConnection. This is used by the inactivity timeout thread
lastAccessedTime,
- last accessed time in millisecondsjava.sql.SQLException
public long getLastAccessedTime() throws java.sql.SQLException
Get the last accessed time on the PooledConnection. This is used by the inactivity timeout thread
java.sql.SQLException
public void removeConnectionEventListener(javax.sql.ConnectionEventListener cel)
Remove an event listener.
removeConnectionEventListener
in interface javax.sql.PooledConnection
cel
- The listener to be removed.public void registerImplicitCacheConnectionEventListener(javax.sql.ConnectionEventListener cel)
Register an event listener for the implicit connection cache.
cel
- The listener to be registeredpublic void setStmtCacheSize(int size) throws java.sql.SQLException
If more than <it> size </it> 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 <it> size </size> is the total number of cursors cached for both the schemes together.
size
- Size of the Cachejava.sql.SQLException
public void setStmtCacheSize(int size, boolean clearMetaData) throws java.sql.SQLException
If more than <it> size </it> 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 <it> size </size> is the total number of cursors cached for both the schemes together.
size
- Size of the CacheclearMetaData
- Whether the state has to be cleared or notjava.sql.SQLException
public int getStmtCacheSize()
public void setStatementCacheSize(int size) throws java.sql.SQLException
size
- 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
java.sql.SQLException
public void setImplicitCachingEnabled(boolean cache) throws java.sql.SQLException
cache
- 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
java.sql.SQLException
public void setExplicitCachingEnabled(boolean cache) throws java.sql.SQLException
cache
- 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
java.sql.SQLException
public void purgeImplicitCache() throws java.sql.SQLException
java.sql.SQLException
public void purgeExplicitCache() throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement getStatementWithKey(java.lang.String key) throws java.sql.SQLException
key
- Specified key to search forjava.sql.SQLException
public java.sql.CallableStatement getCallWithKey(java.lang.String key) throws java.sql.SQLException
key
- Specified key to search forjava.sql.SQLException
public boolean isStatementCacheInitialized()
public final void setProperties(java.util.Hashtable prop)
public javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs
|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |