mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed closed Statement execute throw NPE
This commit is contained in:
@@ -90,7 +90,22 @@ public class DruidPooledStatement extends PoolableWrapper implements Statement {
|
||||
}
|
||||
|
||||
public void incrementExecuteCount() {
|
||||
this.getPoolableConnection().getConnectionHolder().getDataSource().incrementExecuteCount();
|
||||
DruidPooledConnection conn = this.getPoolableConnection();
|
||||
|
||||
if (conn == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
DruidConnectionHolder holder = conn.getConnectionHolder();
|
||||
if (holder == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (holder.getDataSource() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
holder.getDataSource().incrementExecuteCount();
|
||||
}
|
||||
|
||||
protected void transactionRecord(String sql) throws SQLException {
|
||||
|
||||
Reference in New Issue
Block a user