|
|
@ -31,15 +31,20 @@ public class MSSQLValidConnectionChecker extends ValidConnectionCheckerAdapter i |
|
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L; |
|
|
|
private static final long serialVersionUID = 1L; |
|
|
|
|
|
|
|
|
|
|
|
public MSSQLValidConnectionChecker(){ |
|
|
|
public MSSQLValidConnectionChecker() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isValidConnection(final Connection c, String validateQuery, int validationQueryTimeout) throws Exception { |
|
|
|
public boolean isValidConnection(final Connection c, String validateQuery, int validationQueryTimeout) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
if (c.isClosed()) { |
|
|
|
if (c.isClosed()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (validateQuery == null || validateQuery.isEmpty()) { |
|
|
|
|
|
|
|
validateQuery = "select 1"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Statement stmt = null; |
|
|
|
Statement stmt = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|