mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
MySqlValidConnectionChecker use pingInternal replace ping
This commit is contained in:
+3
-3
@@ -44,8 +44,8 @@ public class MySqlValidConnectionChecker extends ValidConnectionCheckerAdapter i
|
||||
|
||||
public MySqlValidConnectionChecker(){
|
||||
try {
|
||||
clazz = Utils.loadClass("com.mysql.jdbc.Connection");
|
||||
ping = clazz.getMethod("ping");
|
||||
clazz = Utils.loadClass("com.mysql.jdbc.MySQLConnection");
|
||||
ping = clazz.getMethod("pingInternal", boolean.class, int.class);
|
||||
if (ping != null) {
|
||||
usePingMethod = true;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class MySqlValidConnectionChecker extends ValidConnectionCheckerAdapter i
|
||||
|
||||
if (clazz.isAssignableFrom(conn.getClass())) {
|
||||
try {
|
||||
ping.invoke(conn);
|
||||
ping.invoke(conn, true, validationQueryTimeout);
|
||||
return true;
|
||||
} catch (InvocationTargetException e) {
|
||||
Throwable cause = e.getCause();
|
||||
|
||||
Reference in New Issue
Block a user