|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.db.SqlUtil
jodd.db.profile.SqlUtilProfiler
Profiles database access by measuring executeQuery
and
executeUpdate
execution times. After measuring, a callback
method in SqlProfilerHandler
is called with profile data.
Usage is quite simple: instead of SqlUtil
use
SqlUtilProfiler
. Before first usage, usually during
initialization, assign handler field to an instance of the
SqlProfilerHandler
.
Note: java System.currentTimeMillis() is not very precise, so as query execution is longer, the duration is more precise, and the error is lower.
SqlUtil
Field Summary | |
static SqlProfilerHandler |
handler
Holds current profile handler. |
Constructor Summary | |
SqlUtilProfiler(ConnectionPool cp)
Overloaded constructor. |
Method Summary | |
java.sql.ResultSet |
executeQuery()
Executes query and measures time. |
int |
executeUpdate()
Executes update and measures time. |
Methods inherited from class jodd.db.SqlUtil |
close, close, closeAll, closeAll, commit, getAutoCommit, getDebugMode, getDefaultAutoCommit, getStoredAutoCommit, rollback, setArray, setAutoCommit, setBigDecimal, setBlob, setBoolean, setByte, setClob, setDate, setDebugMode, setDefaultAutoCommit, setDouble, setFloat, setInt, setLong, setSql, setSql, setStaticSql, setStaticSql, setString, setTimestamp, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static SqlProfilerHandler handler
Constructor Detail |
public SqlUtilProfiler(ConnectionPool cp)
cp
- Method Detail |
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
executeQuery
in class SqlUtil
java.sql.SQLException
public int executeUpdate() throws java.sql.SQLException
executeUpdate
in class SqlUtil
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |