事务时间直方图

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@855 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-19 04:58:43 +00:00
parent dfdf2d747d
commit 1dd5fd7576
7 changed files with 59 additions and 16 deletions
@@ -45,11 +45,18 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
private PreparedStatement stmt;
private final PreparedStatementKey key;
private final String sql;
public PoolablePreparedStatement(PoolableConnection conn, PreparedStatement stmt, PreparedStatementKey key){
public PoolablePreparedStatement(PoolableConnection conn, PreparedStatement stmt, PreparedStatementKey key,
String sql){
super(conn, stmt);
this.stmt = stmt;
this.key = key;
this.sql = sql;
}
public String getSql() {
return sql;
}
public PreparedStatementKey getKey() {
@@ -84,6 +91,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
@Override
public ResultSet executeQuery() throws SQLException {
checkOpen();
transactionRecord(sql);
try {
ResultSet rs = stmt.executeQuery();
@@ -100,6 +109,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
@Override
public int executeUpdate() throws SQLException {
checkOpen();
transactionRecord(sql);
try {
return stmt.executeUpdate();
@@ -332,6 +343,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
@Override
public boolean execute() throws SQLException {
checkOpen();
transactionRecord(sql);
try {
return stmt.execute();
@@ -350,6 +363,12 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
throw checkException(t);
}
}
public int[] executeBatch() throws SQLException {
transactionRecord(sql);
return super.executeBatch();
}
@Override
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {