Browse Source

fix

final/10.0.3
ju 6 years ago
parent
commit
c117be5e40
  1. 23
      fine-druid/src/com/fr/third/alibaba/druid/pool/vendor/MSSQLValidConnectionChecker.java

23
fine-druid/src/com/fr/third/alibaba/druid/pool/vendor/MSSQLValidConnectionChecker.java vendored

@ -28,20 +28,25 @@ import com.fr.third.alibaba.druid.util.JdbcUtils;
* A MSSQLValidConnectionChecker.
*/
public class MSSQLValidConnectionChecker extends ValidConnectionCheckerAdapter implements ValidConnectionChecker, Serializable {
private static final long serialVersionUID = 1L;
public MSSQLValidConnectionChecker(){
public MSSQLValidConnectionChecker() {
}
public boolean isValidConnection(final Connection c, String validateQuery, int validationQueryTimeout) throws Exception {
if (c.isClosed()) {
return false;
}
if (validateQuery == null || validateQuery.isEmpty()) {
validateQuery = "select 1";
}
Statement stmt = null;
try {
stmt = c.createStatement();
if (validationQueryTimeout > 0) {
@ -55,5 +60,5 @@ public class MSSQLValidConnectionChecker extends ValidConnectionCheckerAdapter i
JdbcUtils.close(stmt);
}
}
}
}
Loading…
Cancel
Save