|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.module.database.ConnectionWrapper
org.mmbase.module.database.MultiConnection
MultiConnection is a replacement class for Connection it provides you a multiplexed and reuseable connections from the connection pool. The main function of this class is to 'log' (keep) the last sql statement passed to it. Another function is to keep state (i.e. notifying that it is busy), and to make itself available again to teh connectionpool once it is finished (closed).
| Field Summary | |
static int |
CON_BUSY
|
static int |
CON_FAILED
|
static int |
CON_FINISHED
|
static int |
CON_UNUSED
|
static long |
queries
|
int |
state
|
| Fields inherited from class org.mmbase.module.database.ConnectionWrapper |
con |
| Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
MultiConnection(MultiPool parent,
Connection con)
|
|
| Method Summary | |
protected boolean |
checkAfterException()
Tries to fix the this connection, if it proves to be broken. |
boolean |
checkSQLError(Exception e)
|
void |
claim()
|
void |
close()
Close connections |
Statement |
createStatement()
createStatement returns an SQL Statement object |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
createStatement returns an SQL Statement object |
Statement |
createStatement(int type,
int concurrency,
int holdability)
|
String |
getLastSQL()
|
Connection |
getRealConnection()
Return the underlying real connection. |
int |
getStartTime()
Returns the moment on which the last SQL statement was started in seconds after 1970. |
long |
getStartTimeMillis()
Returns the moment on which the last SQL statement was started in milliseconds after 1970. |
String |
getStateString()
|
int |
getUsage()
|
void |
realclose()
Close connections |
void |
release()
|
void |
setAutoCommit(boolean enableAutoCommit)
If "autoCommit" is true, then all subsequent SQL statements will be executed and committed as individual transactions. |
void |
setLastSQL(String sql)
Called just before every prepare statement. |
String |
toString()
|
| Methods inherited from class org.mmbase.module.database.ConnectionWrapper |
clearWarnings, commit, getAutoCommit, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CON_UNUSED
public static final int CON_BUSY
public static final int CON_FINISHED
public static final int CON_FAILED
public static long queries
public int state
| Constructor Detail |
public MultiConnection(MultiPool parent,
Connection con)
| Method Detail |
public String getStateString()
public void setLastSQL(String sql)
ConnectionWrapper
setLastSQL in class ConnectionWrapperpublic String getLastSQL()
public Statement createStatement()
throws SQLException
createStatement in interface ConnectioncreateStatement in class ConnectionWrapperSQLException
protected boolean checkAfterException()
throws SQLException
public void setAutoCommit(boolean enableAutoCommit)
throws SQLException
setAutoCommit in interface ConnectionsetAutoCommit in class ConnectionWrapperSQLException
public void close()
throws SQLException
close in interface Connectionclose in class ConnectionWrapperSQLException
public void realclose()
throws SQLException
SQLExceptionpublic boolean checkSQLError(Exception e)
public void claim()
public void release()
public int getUsage()
public int getStartTime()
public long getStartTimeMillis()
public String toString()
public Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws SQLException
createStatement in interface ConnectioncreateStatement in class ConnectionWrapperSQLException
public Statement createStatement(int type,
int concurrency,
int holdability)
throws SQLException
createStatement in interface ConnectioncreateStatement in class ConnectionWrapperSQLExceptionpublic Connection getRealConnection()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||