|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.jdbc.DMConnection
The class represents a JDBC connection in the connection pool.
It is essentially a wrapper around a real JDBC connection.
The DMConnection object maintains a state flag to indicate if the connection
is in use and the time the connection was taken from the pool.
This time is used by the ConnectionReaper class to identify hanging connections
Copyright: Copyright (c) 2003
Company: dmonix.org
| Field Summary |
| Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
DMConnection(java.sql.Connection conn,
DMConnectionPool pool)
|
|
| Method Summary | |
void |
clearWarnings()
See the corresponding method on java.sql.Connection |
void |
close()
Returns the connection to the pool. |
void |
commit()
See the corresponding method on java.sql.Connection |
java.sql.Statement |
createStatement()
See the corresponding method on java.sql.Connection |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
See the corresponding method on java.sql.Connection |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
See the corresponding method on java.sql.Connection |
void |
destroy()
Permanently closes the connection and removes it from the pool. |
protected void |
expireLease()
Marks the connection as free. |
boolean |
getAutoCommit()
See the corresponding method on java.sql.Connection |
java.lang.String |
getCatalog()
See the corresponding method on java.sql.Connection |
protected java.sql.Connection |
getConnection()
Returns the connection object. |
int |
getHoldability()
See the corresponding method on java.sql.Connection |
long |
getLastUse()
Returns the time when this connection was last used. |
java.sql.DatabaseMetaData |
getMetaData()
See the corresponding method on java.sql.Connection |
int |
getTransactionIsolation()
See the corresponding method on java.sql.Connection |
java.util.Map |
getTypeMap()
See the corresponding method on java.sql.Connection |
java.sql.SQLWarning |
getWarnings()
See the corresponding method on java.sql.Connection |
boolean |
inUse()
Returns the status flag for this connection. |
boolean |
isClosed()
See the corresponding method on java.sql.Connection |
boolean |
isReadOnly()
See the corresponding method on java.sql.Connection |
boolean |
lease()
The method attempts to mark a connection as busy. |
java.lang.String |
nativeSQL(java.lang.String sql)
See the corresponding method on java.sql.Connection |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
See the corresponding method on java.sql.Connection |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
See the corresponding method on java.sql.Connection |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autogeneratedKeys)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
See the corresponding method on java.sql.Connection |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
See the corresponding method on java.sql.Connection |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
See the corresponding method on java.sql.Connection |
void |
rollback()
See the corresponding method on java.sql.Connection |
void |
rollback(java.sql.Savepoint savepoint)
See the corresponding method on java.sql.Connection |
void |
setAutoCommit(boolean autoCommit)
See the corresponding method on java.sql.Connection |
void |
setCatalog(java.lang.String catalog)
See the corresponding method on java.sql.Connection |
void |
setHoldability(int holdability)
See the corresponding method on java.sql.Connection |
void |
setReadOnly(boolean readOnly)
See the corresponding method on java.sql.Connection |
java.sql.Savepoint |
setSavepoint()
See the corresponding method on java.sql.Connection |
java.sql.Savepoint |
setSavepoint(java.lang.String savepoint)
See the corresponding method on java.sql.Connection |
void |
setTransactionIsolation(int level)
See the corresponding method on java.sql.Connection |
void |
setTypeMap(java.util.Map map)
See the corresponding method on java.sql.Connection |
java.lang.String |
toString()
|
boolean |
validate()
The method attempts to validate if the connection is busy or not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DMConnection(java.sql.Connection conn,
DMConnectionPool pool)
| Method Detail |
public boolean lease()
public boolean validate()
public boolean inUse()
public long getLastUse()
public void close()
throws java.sql.SQLException
destroy()
should be used.
close in interface java.sql.Connectionjava.sql.SQLException
public void destroy()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void expireLease()
protected java.sql.Connection getConnection()
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql - resultSetType - resultSetConcurrency - resultSetHoldability -
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autogeneratedKeys)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql - autogeneratedKeys -
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql - columnIndexes -
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql - columnNames -
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql -
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.sql.Connection
prepareStatement in interface java.sql.Connectionsql - resultSetType - resultSetConcurrency -
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
java.sql.Connection
prepareCall in interface java.sql.Connectionsql - resultSetType - resultSetConcurrency - resultSetHoldability -
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.sql.Connection
prepareCall in interface java.sql.Connectionsql - resultSetType - resultSetConcurrency -
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
java.sql.Connection
prepareCall in interface java.sql.Connectionsql -
java.sql.SQLException
public java.sql.Statement createStatement()
throws java.sql.SQLException
java.sql.Connection
createStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
java.sql.Connection
createStatement in interface java.sql.ConnectionresultSetType - resultSetConcurrency - resultSetHoldability -
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.sql.Connection
createStatement in interface java.sql.ConnectionresultSetType - resultSetConcurrency -
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
java.sql.Connection
nativeSQL in interface java.sql.Connectionsql -
java.sql.SQLException
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
java.sql.Connection
setAutoCommit in interface java.sql.ConnectionautoCommit -
java.sql.SQLException
public boolean getAutoCommit()
throws java.sql.SQLException
java.sql.Connection
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException
public void commit()
throws java.sql.SQLException
java.sql.Connection
commit in interface java.sql.Connectionjava.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint)
throws java.sql.SQLException
java.sql.Connection
releaseSavepoint in interface java.sql.Connectionsavepoint -
java.sql.SQLException
public void rollback()
throws java.sql.SQLException
java.sql.Connection
rollback in interface java.sql.Connectionjava.sql.SQLException
public void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
java.sql.Connection
rollback in interface java.sql.Connectionsavepoint -
java.sql.SQLException
public boolean isClosed()
throws java.sql.SQLException
java.sql.Connection
isClosed in interface java.sql.Connectionjava.sql.SQLException
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
java.sql.Connection
getMetaData in interface java.sql.Connectionjava.sql.SQLException
public void setHoldability(int holdability)
throws java.sql.SQLException
java.sql.Connection
setHoldability in interface java.sql.Connectionholdability -
java.sql.SQLException
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
java.sql.Connection
setReadOnly in interface java.sql.ConnectionreadOnly -
java.sql.SQLException
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
java.sql.Connection
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String savepoint)
throws java.sql.SQLException
java.sql.Connection
setSavepoint in interface java.sql.Connectionsavepoint -
java.sql.SQLException
public boolean isReadOnly()
throws java.sql.SQLException
java.sql.Connection
isReadOnly in interface java.sql.Connectionjava.sql.SQLException
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
java.sql.Connection
setCatalog in interface java.sql.Connectioncatalog -
java.sql.SQLException
public java.lang.String getCatalog()
throws java.sql.SQLException
java.sql.Connection
getCatalog in interface java.sql.Connectionjava.sql.SQLException
public int getHoldability()
throws java.sql.SQLException
java.sql.Connection
getHoldability in interface java.sql.Connectionjava.sql.SQLException
public void setTransactionIsolation(int level)
throws java.sql.SQLException
java.sql.Connection
setTransactionIsolation in interface java.sql.Connectionlevel -
java.sql.SQLException
public int getTransactionIsolation()
throws java.sql.SQLException
java.sql.Connection
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
java.sql.Connection
getWarnings in interface java.sql.Connectionjava.sql.SQLException
public void clearWarnings()
throws java.sql.SQLException
java.sql.Connection
clearWarnings in interface java.sql.Connectionjava.sql.SQLException
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
java.sql.Connection
setTypeMap in interface java.sql.Connectionmap -
java.sql.SQLException
public java.util.Map getTypeMap()
throws java.sql.SQLException
java.sql.Connection
getTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||