snaq.db
Interface ConnectionValidator

All Known Implementing Classes:
AutoCommitValidator, QueryValidator, Select1Validator, SimpleQueryValidator

public interface ConnectionValidator

Interface for validating database connections. This interface can be implemented by a class in order to provide custom database connection validation. To use the custom validator class make sure you call the setValidator method in either the ConnectionPool object or the ConnectionPoolManager in your code (or use the properties file version with the pool manager).

NOTE: The connection passed to the validator is the raw connection from the driver, and has none of the wrapper protection afforded by the pooling mechanism. Implementations should take care to only check the connection's viability, and never make unexpected alterations. Failure to follow this could result in unpredictable pool behaviour.

Author:
Giles Winstanley

Method Summary
 boolean isValid(Connection con)
          Determines whether the specified connection is good to use.
 

Method Detail

isValid

boolean isValid(Connection con)
                throws SQLException
Determines whether the specified connection is good to use.

Parameters:
con - Connection instance to check for validity
Returns:
true if the specified connection is good to use, false otherwise
Throws:
SQLException