mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
事务时间直方图
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@855 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -83,6 +83,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final ResultSet executeQuery(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
@@ -96,9 +98,17 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
}
|
||||
}
|
||||
|
||||
protected void transactionRecord(String sql) {
|
||||
if (conn.getTransactionInfo() != null) {
|
||||
conn.getTransactionInfo().getSqlList().add(sql);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int executeUpdate(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql);
|
||||
@@ -356,6 +366,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final void addBatch(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
stmt.addBatch(sql);
|
||||
@@ -376,7 +388,7 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int[] executeBatch() throws SQLException {
|
||||
public int[] executeBatch() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
@@ -424,6 +436,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, autoGeneratedKeys);
|
||||
@@ -435,6 +449,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final int executeUpdate(String sql, int columnIndexes[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, columnIndexes);
|
||||
@@ -446,6 +462,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final int executeUpdate(String sql, String columnNames[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, columnNames);
|
||||
@@ -457,6 +475,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, autoGeneratedKeys);
|
||||
@@ -468,6 +488,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final boolean execute(String sql, int columnIndexes[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, columnIndexes);
|
||||
@@ -479,6 +501,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
@Override
|
||||
public final boolean execute(String sql, String columnNames[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
transactionRecord(sql);
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, columnNames);
|
||||
|
||||
Reference in New Issue
Block a user