|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jwarp.service.connectionpool.ConnectionWrapper
This class is a wrapper around a Connection, overriding the close method to just inform the pool that it's available for reuse again, and the isClosed method to return the state of the wrapper instead of the Connection.
| Field Summary | |
(package private) java.sql.Connection |
realConn
The underlying sql connection |
| Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
ConnectionWrapper(java.sql.Connection realConn,
ConnectionPool pool,
LogWriter log)
Constructs a new connection wrapper |
|
| Method Summary | |
void |
clearWarnings()
Wrapped methods from the connection interface. |
void |
close()
Inform the ConnectionPool that the ConnectionWrapper is closed. |
void |
commit()
Wrapped methods from the connection interface. |
java.sql.Statement |
createStatement()
Wrapped methods from the connection interface. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Wrapped methods from the connection interface. |
void |
finalize()
If the wrapper has not been closed, it is closed now. |
boolean |
getAutoCommit()
Wrapped methods from the connection interface. |
java.lang.String |
getCatalog()
Wrapped methods from the connection interface. |
java.sql.DatabaseMetaData |
getMetaData()
Wrapped methods from the connection interface. |
ConnectionPool |
getPool()
Returns the pool of the connection. |
int |
getTransactionIsolation()
Wrapped methods from the connection interface. |
java.util.Map |
getTypeMap()
Wrapped methods from the connection interface. |
static int |
getUnclosedConnectionsFinalized()
|
java.sql.SQLWarning |
getWarnings()
Wrapped methods from the connection interface. |
boolean |
isClosed()
Returns true if the ConnectionWrapper is closed, false otherwise. |
boolean |
isReadOnly()
Wrapped methods from the connection interface. |
java.lang.String |
nativeSQL(java.lang.String sql)
Wrapped methods from the connection interface. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Wrapped methods from the connection interface. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int i1,
int i2)
Wrapped methods from the connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Wrapped methods from the connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int i1,
int i2)
Wrapped methods from the connection interface. |
void |
rollback()
Wrapped methods from the connection interface. |
void |
setAutoCommit(boolean autoCommit)
Wrapped methods from the connection interface. |
void |
setCatalog(java.lang.String catalog)
Wrapped methods from the connection interface. |
void |
setReadOnly(boolean readOnly)
Wrapped methods from the connection interface. |
void |
setTransactionIsolation(int level)
Wrapped methods from the connection interface. |
void |
setTypeMap(java.util.Map map)
Wrapped methods from the connection interface. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
java.sql.Connection realConn
| Constructor Detail |
public ConnectionWrapper(java.sql.Connection realConn,
ConnectionPool pool,
LogWriter log)
realConn - The JDBC connectionpool - The ConnectionPoool that manages the connection.| Method Detail |
public void close()
throws java.sql.SQLException
close in interface java.sql.Connectionjava.sql.SQLException -
public boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfacepublic ConnectionPool getPool()
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int i1,
int i2)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int i1,
int i2)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnection
public java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLException - must be thrown for implementing the connection interfaceConnectionpublic void finalize()
finalize in class java.lang.Objectpublic static int getUnclosedConnectionsFinalized()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||