org.objectledge.database
Class MonitoringCallableStatement

java.lang.Object
  extended by org.objectledge.database.impl.DelegatingStatement
      extended by org.objectledge.database.impl.DelegatingPreparedStatement
          extended by org.objectledge.database.impl.DelegatingCallableStatement
              extended by org.objectledge.database.MonitoringCallableStatement
All Implemented Interfaces:
CallableStatement, PreparedStatement, Statement

public class MonitoringCallableStatement
extends DelegatingCallableStatement

CallableStatement wrapper that monitors the number of DB reads/writes, and their duration.

Version:
$Id: MonitoringCallableStatement.java,v 1.1 2005/10/10 09:44:50 rafal Exp $
Author:
RafaƂ Krzewski

Field Summary
private  ThreadDataSource.ThreadConnection threadConn
           
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
MonitoringCallableStatement(CallableStatement callableStatement, String sql, ThreadDataSource.ThreadConnection threadConn)
          Creates a new MonitoringCallableStatement instance.
 
Method Summary
 boolean execute()
          
 int[] executeBatch()
          
 ResultSet executeQuery()
          
 int executeUpdate()
          
 
Methods inherited from class org.objectledge.database.impl.DelegatingCallableStatement
clearParameters2, getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBody, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObject, getRef, getRef, getShort, getShort, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setBigDecimal, setBinaryStream, setBoolean, setByte, setBytes, setCharacterStream, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
 
Methods inherited from class org.objectledge.database.impl.DelegatingPreparedStatement
addBatch, clearParameters, getMetaData, getParameterList, getParameterMetaData, getSQL, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from class org.objectledge.database.impl.DelegatingStatement
addBatch, addToBatchBuffer, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getBatchBuffer, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Field Detail

threadConn

private final ThreadDataSource.ThreadConnection threadConn
Constructor Detail

MonitoringCallableStatement

public MonitoringCallableStatement(CallableStatement callableStatement,
                                   String sql,
                                   ThreadDataSource.ThreadConnection threadConn)
Creates a new MonitoringCallableStatement instance.

Parameters:
callableStatement - delegate callable statement.
sql - statement body.
threadConn - the associated ThreadConnection.
Method Detail

execute

public boolean execute()
                throws SQLException

Specified by:
execute in interface PreparedStatement
Overrides:
execute in class DelegatingPreparedStatement
Throws:
SQLException

executeQuery

public ResultSet executeQuery()
                       throws SQLException

Specified by:
executeQuery in interface PreparedStatement
Overrides:
executeQuery in class DelegatingPreparedStatement
Throws:
SQLException

executeUpdate

public int executeUpdate()
                  throws SQLException

Specified by:
executeUpdate in interface PreparedStatement
Overrides:
executeUpdate in class DelegatingPreparedStatement
Throws:
SQLException

executeBatch

public int[] executeBatch()
                   throws SQLException

Specified by:
executeBatch in interface Statement
Overrides:
executeBatch in class DelegatingStatement
Throws:
SQLException


Copyright © 2003-2006 objectledge.org. All Rights Reserved.