mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve Utils Performance
This commit is contained in:
@@ -3,6 +3,7 @@ package com.alibaba.druid.util;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.stat.JdbcSqlStat;
|
||||
import com.alibaba.druid.support.logging.Log;
|
||||
import com.alibaba.druid.support.logging.LogFactory;
|
||||
|
||||
@@ -13,6 +14,10 @@ public class JdbcSqlStatUtils {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Map<String, Object> getData(Object jdbcSqlStat) {
|
||||
try {
|
||||
if (jdbcSqlStat.getClass() == JdbcSqlStat.class) {
|
||||
return ((JdbcSqlStat) jdbcSqlStat).getData();
|
||||
}
|
||||
|
||||
Method method = jdbcSqlStat.getClass().getMethod("getData");
|
||||
Object obj = method.invoke(jdbcSqlStat);
|
||||
return (Map<String, Object>) obj;
|
||||
|
||||
Reference in New Issue
Block a user