mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for validConnectionChecker.
This commit is contained in:
+5
-1
@@ -81,7 +81,7 @@ public class MySqlValidConnectionChecker extends ValidConnectionCheckerAdapter i
|
||||
this.usePingMethod = usePingMethod;
|
||||
}
|
||||
|
||||
public boolean validConnection(Connection conn, String validateQuery, int validationQueryTimeout) throws Exception {
|
||||
public boolean isValidConnection(Connection conn, String validateQuery, int validationQueryTimeout) throws Exception {
|
||||
if (conn.isClosed()) {
|
||||
return false;
|
||||
}
|
||||
@@ -105,6 +105,10 @@ public class MySqlValidConnectionChecker extends ValidConnectionCheckerAdapter i
|
||||
}
|
||||
}
|
||||
|
||||
if (validateQuery == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Statement stmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class OracleValidConnectionChecker extends ValidConnectionCheckerAdapter
|
||||
this.timeout = seconds;
|
||||
}
|
||||
|
||||
public boolean validConnection(Connection conn, String validateQuery, int validationQueryTimeout) throws Exception {
|
||||
public boolean isValidConnection(Connection conn, String validateQuery, int validationQueryTimeout) throws Exception {
|
||||
if (validateQuery == null || validateQuery.isEmpty()) {
|
||||
validateQuery = this.defaultValidateQuery;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user