Abstract
ConnectionValidator implementation that validates
database connections by issuing a SQL query.
To create a simple ConnectionValidator implementation which validates
using a SQL query, extend this class and implement the abstract methods.
For example, the
#getQueryString() method could be implemented to
return the string:
SELECT * FROM test WHERE test_id < 10;
This would cause this SQL query to be issued to the database whenever
a connection needs validating. If the query causes a
SQLExceptionto be thrown then the validation automatically fails.
If the query completes successfully, the generated
ResultSetis then passed to the
#checkResults(ResultSet) method.
This class is provided as a convenience for providing
connection validation.