mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge branch 'master' of https://github.com/wenshao/druid
This commit is contained in:
@@ -82,9 +82,9 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
|
||||
public final static int DEFAULT_MIN_IDLE = 0;
|
||||
public final static int DEFAULT_MAX_WAIT = -1;
|
||||
public final static String DEFAULT_VALIDATION_QUERY = null; //
|
||||
public final static boolean DEFAULT_TEST_ON_BORROW = true;
|
||||
public final static boolean DEFAULT_TEST_ON_BORROW = false;
|
||||
public final static boolean DEFAULT_TEST_ON_RETURN = false;
|
||||
public final static boolean DEFAULT_WHILE_IDLE = false;
|
||||
public final static boolean DEFAULT_WHILE_IDLE = true;
|
||||
public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = -1L;
|
||||
public static final long DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS = 30 * 1000;
|
||||
public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 3;
|
||||
|
||||
@@ -575,6 +575,10 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
if (!(isTestOnBorrow() || isTestOnReturn() || isTestWhileIdle())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.validConnectionChecker != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getValidationQuery() != null && this.getValidationQuery().length() > 0) {
|
||||
return;
|
||||
|
||||
@@ -45,10 +45,6 @@ public class MSSQLValidConnectionChecker implements ValidConnectionChecker, Seri
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valiateQuery == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Statement stmt = null;
|
||||
|
||||
try {
|
||||
|
||||
@@ -61,10 +61,6 @@ public class MySqlValidConnectionChecker implements ValidConnectionChecker, Seri
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valiateQuery == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (driverHasPingMethod) {
|
||||
if (conn instanceof DruidPooledConnection) {
|
||||
conn = ((DruidPooledConnection) conn).getConnection();
|
||||
|
||||
@@ -62,10 +62,6 @@ public class OracleValidConnectionChecker implements ValidConnectionChecker, Ser
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valiateQuery == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
if (conn instanceof DruidPooledConnection) {
|
||||
conn = ((DruidPooledConnection) conn).getConnection();
|
||||
|
||||
Reference in New Issue
Block a user