mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正Oracle校验器问题
修正原先的实现中isValidConnection方法忽略validationQueryTimeout参数的问题,优先使用validationQ ueryTimeout,然后才是timeout
This commit is contained in:
+4
-2
@@ -70,15 +70,17 @@ public class OracleValidConnectionChecker extends ValidConnectionCheckerAdapter
|
||||
conn = ((ConnectionProxy) conn).getRawObject();
|
||||
}
|
||||
|
||||
if (validateQuery == null || validateQuery.length() == 0) {
|
||||
if (validateQuery == null || validateQuery.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int queryTimeout = validationQueryTimeout < 0 ? timeout : validationQueryTimeout;
|
||||
|
||||
Statement stmt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
stmt = conn.createStatement();
|
||||
stmt.setQueryTimeout(timeout);
|
||||
stmt.setQueryTimeout(queryTimeout);
|
||||
rs = stmt.executeQuery(validateQuery);
|
||||
return true;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user