减少重复代码

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@449 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-07-15 09:31:25 +00:00
parent 777832ac03
commit 49646878a2
5 changed files with 24 additions and 36 deletions
@@ -29,6 +29,7 @@ import javax.management.openmbean.OpenType;
import javax.management.openmbean.SimpleType;
import com.alibaba.druid.util.JMXUtils;
import com.alibaba.druid.util.JdbcUtils;
/**
* @author wenshao<szujobs@hotmail.com>
@@ -557,9 +558,7 @@ public final class JdbcSqlStat implements JdbcSqlStatMBean {
map.put("LastErrorMessage", lastError.getMessage());
map.put("LastErrorClass", lastError.getClass().getName());
StringWriter buf = new StringWriter();
lastError.printStackTrace(new PrintWriter(buf));
map.put("LastErrorStackTrace", buf.toString());
map.put("LastErrorStackTrace", JdbcUtils.getStackTrace(lastError));
map.put("LastErrorTime", new Date(executeErrorLastTime));
} else {
map.put("LastErrorMessage", null);