|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.database.connection.ConnectionWrapper
A wrapper around java.sql.Connection
for convenient handling of
prepared SQL statements.
Field Summary | |
protected java.sql.Connection |
conn
The raw database connection. |
private boolean |
dirty
The dirty flag. |
protected int |
id
|
protected boolean |
inTransaction
True if a transaction is in progress. |
protected static org.apache.log4j.Logger |
log
Logger. |
protected ConnectionPool |
pool
|
protected java.util.HashMap |
stmts
A collection of prepared statements created using this connection. |
Constructor Summary | |
ConnectionWrapper(java.sql.Connection conn,
ConnectionPool pool,
int id)
Wraps a new wrapper around an already established connection. |
Method Summary | |
(package private) void |
beginTransaction()
|
void |
close()
Close this connection. |
java.sql.Connection |
getConnection()
Returns the raw java.sql.Connection object
associated with this handler. |
java.sql.PreparedStatement |
getStatement(java.lang.String statement)
Converts the given SQL statement to a PreparedStatement . |
boolean |
isClosed()
Returns true if this connection is closed. |
boolean |
isDirty()
Returns the dirty flag. |
boolean |
isFunctional()
Tries to determine if the connection is functional by executing a simple query against the database. |
(package private) boolean |
isInTransaction()
Used by ConnectionPool to determine if the connection may be
released back to its pool. |
abstract boolean |
isReadonly()
|
void |
setDirty()
Sets the dirty flag. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.sql.Connection conn
protected final int id
protected final ConnectionPool pool
protected boolean inTransaction
protected java.util.HashMap stmts
protected static org.apache.log4j.Logger log
private boolean dirty
Constructor Detail |
public ConnectionWrapper(java.sql.Connection conn, ConnectionPool pool, int id)
Method Detail |
public java.sql.Connection getConnection()
java.sql.Connection
object
associated with this handler.
public java.sql.PreparedStatement getStatement(java.lang.String statement) throws java.sql.SQLException
PreparedStatement
. This is usually equivalent to
the prepareStatement
method of the wrapped
java.sql.Connection
object.
java.sql.SQLException
public boolean isFunctional()
public void close()
public boolean isClosed()
public boolean isDirty()
public void setDirty()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract boolean isReadonly()
void beginTransaction() throws VOMSException
VOMSException
boolean isInTransaction()
ConnectionPool
to determine if the connection may be
released back to its pool.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |