public final class ConnectionProxy extends Object implements Connection
This also contains all of the data associated with a connection, for debugging, logging and statistics gathering. Most of the data herein is locked by this. FIXME Must implement java.sql.PooledConnection.
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
void |
addCommitListener(IDatabaseEventListener c)
Add a commit-time listener to this connection.
|
void |
addOwnerInfo(Object oo)
Adds owner info objects to the connection.
|
void |
checkHangState(to.etc.dbpool.HangCheckState hs)
Called without any locks to see if this connection is a "hanging" connection.
|
void |
clearWarnings() |
void |
close()
The "normal" close releases all resources associated with this connection by closing
them, then it returns the connection to the pool.
|
void |
commit()
Commit proxies to the real connection, but also handles the "disable commits" per-thread option
that can be set by
ConnectionPool.setCommitDisabled(boolean) and the commit-time listeners
that can be added by addCommitListener(IDatabaseEventListener). |
Array |
createArrayOf(String arg0,
Object[] arg1) |
Blob |
createBlob() |
Clob |
createClob() |
NClob |
createNClob() |
SQLXML |
createSQLXML() |
Statement |
createStatement() |
Statement |
createStatement(int p1,
int p2) |
Statement |
createStatement(int p1,
int p2,
int p3) |
Struct |
createStruct(String arg0,
Object[] arg1) |
void |
forceClosed()
Actually closes a proxy, if not already done.
|
Tracepoint |
getAllocationPoint() |
long |
getAllocationTime()
Return the immutable allocation time.
|
boolean |
getAutoCommit() |
String |
getCatalog() |
Properties |
getClientInfo() |
String |
getClientInfo(String arg0) |
Tracepoint |
getCloseLocation() |
int |
getHoldability() |
int |
getId() |
long |
getLastUsedTime()
Return the time this was last used.
|
DatabaseMetaData |
getMetaData() |
int |
getNetworkTimeout() |
Thread |
getOwnerThread() |
ConnectionPool |
getPool() |
String |
getPoolID() |
Connection |
getRealConnection()
Returns the REAL database connection (the one obtained from the JDBC driver)
for this proxy.
|
String |
getSchema() |
ConnState |
getState() |
List<Tracepoint> |
getTraceList()
Return the list of tracepoints, from old to new.
|
int |
getTransactionIsolation() |
Map |
getTypeMap() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isUnpooled()
THIS MAY ONLY LOCK THIS AND MUST BE IMMUTABLE.
|
boolean |
isValid(int arg0) |
boolean |
isWrapperFor(Class<?> iface) |
String |
nativeSQL(String p1) |
CallableStatement |
prepareCall(String p1) |
CallableStatement |
prepareCall(String p1,
int p2,
int p3) |
CallableStatement |
prepareCall(String name,
int a,
int b,
int c) |
PreparedStatement |
prepareStatement(String p1) |
PreparedStatement |
prepareStatement(String p1,
int p2) |
PreparedStatement |
prepareStatement(String p1,
int[] p2) |
PreparedStatement |
prepareStatement(String p1,
int p2,
int p3) |
PreparedStatement |
prepareStatement(String p1,
int p2,
int p3,
int p4) |
PreparedStatement |
prepareStatement(String a,
String[] ar) |
void |
releaseSavepoint(Savepoint sp) |
void |
removeCommitListener(IDatabaseEventListener c)
Remove an earlier registered commit listener - silly usage, questionable interface.
|
protected void |
removeResource(Object o)
This removes the resource from the resource list because it was normally closed.
|
void |
rollback() |
void |
rollback(Savepoint sp) |
void |
setAutoCommit(boolean p1) |
void |
setCatalog(String p1) |
void |
setClientInfo(Properties arg0) |
void |
setClientInfo(String arg0,
String arg1) |
void |
setHoldability(int m) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
void |
setReadOnly(boolean p1) |
Savepoint |
setSavepoint() |
Savepoint |
setSavepoint(String name) |
void |
setSchema(String schema) |
void |
setTransactionIsolation(int p1) |
void |
setTypeMap(Map p1) |
void |
setUncloseable(boolean unclosable)
Forbid a connection from being closed using the normal close() method.
|
protected to.etc.dbpool.IConnectionEventListener |
statsHandler() |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
public long getAllocationTime()
public Tracepoint getAllocationPoint()
public Thread getOwnerThread()
public String getPoolID()
public int getId()
@Nonnull protected to.etc.dbpool.IConnectionEventListener statsHandler()
public ConnectionPool getPool()
public final boolean isUnpooled()
public void addOwnerInfo(Object oo)
oo - public ConnState getState()
public Connection getRealConnection()
public void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionpublic void forceClosed()
throws SQLException
SQLExceptionpublic void commit()
throws SQLException
ConnectionPool.setCommitDisabled(boolean) and the commit-time listeners
that can be added by addCommitListener(IDatabaseEventListener).commit in interface ConnectionSQLExceptionpublic List<Tracepoint> getTraceList()
@Nullable public Tracepoint getCloseLocation()
public long getLastUsedTime()
public void checkHangState(to.etc.dbpool.HangCheckState hs)
Unpooled connections have their hang state checked using a staggered time interval. They are never cleared unless we are in "urgent" mode.
Longliving connections are not checked using staggered time interval. They are never cleared unless we are in "urgent" mode.
hs - protected void removeResource(Object o)
o - the resource to remove.public void setUncloseable(boolean unclosable)
public void addCommitListener(@Nonnull IDatabaseEventListener c)
c - public void removeCommitListener(@Nonnull IDatabaseEventListener c)
c - public PreparedStatement prepareStatement(String p1) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String p1, int[] p2) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String p1, int p2) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String p1, int p2, int p3) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String p1, int p2, int p3, int p4) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String name, int a, int b, int c) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String a, String[] ar) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic Statement createStatement() throws SQLException
createStatement in interface ConnectionSQLExceptionpublic Statement createStatement(int p1, int p2) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic Statement createStatement(int p1, int p2, int p3) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String p1, int p2, int p3) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String p1) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic void setCatalog(String p1) throws SQLException
setCatalog in interface ConnectionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLExceptionpublic Map getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLExceptionpublic void setTransactionIsolation(int p1)
throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface ConnectionSQLExceptionpublic void setAutoCommit(boolean p1)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic String getCatalog() throws SQLException
getCatalog in interface ConnectionSQLExceptionpublic boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic void setReadOnly(boolean p1)
throws SQLException
setReadOnly in interface ConnectionSQLExceptionpublic boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic String nativeSQL(String p1) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic void setTypeMap(Map p1) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint sp) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic void rollback(Savepoint sp) throws SQLException
rollback in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLExceptionpublic void setHoldability(int m)
throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic Array createArrayOf(String arg0, Object[] arg1) throws SQLException
createArrayOf in interface ConnectionSQLExceptionpublic Blob createBlob() throws SQLException
createBlob in interface ConnectionSQLExceptionpublic Clob createClob() throws SQLException
createClob in interface ConnectionSQLExceptionpublic NClob createNClob() throws SQLException
createNClob in interface ConnectionSQLExceptionpublic SQLXML createSQLXML() throws SQLException
createSQLXML in interface ConnectionSQLExceptionpublic Struct createStruct(String arg0, Object[] arg1) throws SQLException
createStruct in interface ConnectionSQLExceptionpublic Properties getClientInfo() throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic String getClientInfo(String arg0) throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic boolean isValid(int arg0)
throws SQLException
isValid in interface ConnectionSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setClientInfo(Properties arg0) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic void setClientInfo(String arg0, String arg1) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema in interface ConnectionSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface ConnectionSQLExceptionpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout in interface ConnectionSQLExceptionpublic int getNetworkTimeout()
throws SQLException
getNetworkTimeout in interface ConnectionSQLExceptionCopyright © 2017 etc.to. All rights reserved.