java.lang .Object org.mmbase.module.database .ConnectionWrapper org.mmbase.module.database .MultiConnectionImplementation MultiConnectionImplementation public class MultiConnectionImplementation extends ConnectionWrapper implements MultiConnection (Code) 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).
author: vproauthor: Pierre van Roodenversion: $Id: MultiConnectionImplementation.java,v 1.2 2007/12/06 08:05:51 michiel Exp $since: MMBase-1.9 (as 'MultiConnection' in < 1.9)
CON_BUSY final public static int CON_BUSY (Code)
CON_FAILED final public static int CON_FAILED (Code)
CON_FINISHED final public static int CON_FINISHED (Code)
CON_UNUSED final public static int CON_UNUSED (Code)
queries public static long queries(Code)
checkAfterException public boolean checkAfterException() throws SQLException (Code) Tries to fix the this connection, if it proves to be broken. It is supposed to be broken if
the query "SELECT 1 FROM " does yield an exception.
This method is meant to be called in the catch after trying to use the connection.
true
if connection was broken and successfully repaired. false
if connection was not broken.throws: SQLException - If connection is broken and no new one could be obtained.since: MMBase-1.7.1
claim public void claim()(Code)
createStatement public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException (Code) createStatement returns an SQL Statement object
createStatement public Statement createStatement(int type, int concurrency, int holdability) throws SQLException (Code) since: MMBase 1.5, JDBC 1.4
getRealConnection public Connection getRealConnection()(Code) Return the underlying real connection. NOTE: use with extreme caution! MMBase is supposed to look
after it's own connections. This method is public only for the reason that specific database
implementations need access to this connection in order to safely clear them before they
can be put back in the connection pool.
#unwrap(Connection.class)
getStartTime public int getStartTime()(Code) Returns the moment on which the last SQL statement was started in seconds after 1970.
getStartTimeMillis public long getStartTimeMillis()(Code) Returns the moment on which the last SQL statement was started in milliseconds after 1970.
getUsage public int getUsage()(Code)
release public void release()(Code)
resetUsage public void resetUsage()(Code) since: MMBase-1.8
setAutoCommit public void setAutoCommit(boolean enableAutoCommit) throws SQLException (Code) If "autoCommit" is true, then all subsequent SQL statements will
be executed and committed as individual transactions. Otherwise
(if "autoCommit" is false) then subsequent SQL statements will
all be part of the same transaction , which must be explicitly
committed with either a "commit" or "rollback" call.
By default new connections are initialized with autoCommit "true".
Methods inherited from org.mmbase.module.database.ConnectionWrapper public void clearWarnings() throws SQLException (Code) (Java Doc) public void close() throws SQLException (Code) (Java Doc) public void commit() throws SQLException (Code) (Java Doc) public Array createArrayOf(String typeName, Object [] elements) throws SQLException (Code) (Java Doc) public Statement createStatement() throws SQLException (Code) (Java Doc) public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException (Code) (Java Doc) public Statement createStatement(int type, int concurrency, int holdability) throws SQLException (Code) (Java Doc) public Struct createStruct(String typeName, Object [] attributes) throws SQLException (Code) (Java Doc) public boolean getAutoCommit() throws SQLException (Code) (Java Doc) public String getCatalog() throws SQLException (Code) (Java Doc) public String getClientInfo(String name) throws SQLException (Code) (Java Doc) public Properties getClientInfo() throws SQLException (Code) (Java Doc) public int getHoldability() throws SQLException (Code) (Java Doc) public DatabaseMetaData getMetaData() throws SQLException (Code) (Java Doc) public int getTransactionIsolation() throws SQLException (Code) (Java Doc) public Map getTypeMap() throws SQLException (Code) (Java Doc) public SQLWarning getWarnings() throws SQLException (Code) (Java Doc) public boolean isClosed() throws SQLException (Code) (Java Doc) public boolean isReadOnly() throws SQLException (Code) (Java Doc) public boolean isValid(int i) throws SQLException (Code) (Java Doc) public boolean isWrapperFor(Class > iface)(Code) (Java Doc) public String nativeSQL(String query) throws SQLException (Code) (Java Doc) public CallableStatement prepareCall(String sql) throws SQLException (Code) (Java Doc) public CallableStatement prepareCall(String sql, int i, int y) throws SQLException (Code) (Java Doc) public CallableStatement prepareCall(String sql, int type, int concurrency, int holdability) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql, String [] columnNames) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql, int type, int concurrency, int holdability) throws SQLException (Code) (Java Doc) public PreparedStatement prepareStatement(String sql, int i, int y) throws SQLException (Code) (Java Doc) public void releaseSavepoint(Savepoint savepoint) throws SQLException (Code) (Java Doc) public void rollback() throws SQLException (Code) (Java Doc) public void rollback(Savepoint savepoint) throws SQLException (Code) (Java Doc) public void setAutoCommit(boolean enableAutoCommit) throws SQLException (Code) (Java Doc) public void setCatalog(String catalog) throws SQLException (Code) (Java Doc) public void setHoldability(int holdability) throws SQLException (Code) (Java Doc) protected void setLastSQL(String sql)(Code) (Java Doc) public void setReadOnly(boolean readOnly) throws SQLException (Code) (Java Doc) public Savepoint setSavepoint() throws SQLException (Code) (Java Doc) public Savepoint setSavepoint(String name) throws SQLException (Code) (Java Doc) public void setTransactionIsolation(int level) throws SQLException (Code) (Java Doc) public void setTypeMap(Map mp) throws SQLException (Code) (Java Doc) public T unwrap(Class <T> iface)(Code) (Java Doc)