代码重构

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@314 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-06-29 09:47:21 +00:00
parent 6c9e33cf23
commit 33957a5127
@@ -35,18 +35,16 @@ public class MySqlValidConnectionChecker implements ValidConnectionChecker, Seri
}
public boolean isValidConnection(Connection c) {
Connection conn = null;
try {
Connection conn = (Connection) c.unwrap(clazz);
if (conn != null) {
c = conn;
}
conn = (Connection) c.unwrap(clazz);
} catch (SQLException e) {
LOG.warn("Unexpected error in ping", e);
return false;
}
// if there is a ping method then use it, otherwise just use a 'SELECT 1' statement
if (driverHasPingMethod) {
if (conn != null && driverHasPingMethod) {
try {
ping.invoke(c);
return true;