Interface ValidConnection
java.sql.Connection object and to
identify connection objects that should no longer be used for connection
pooling.
The isValid() method can be used for checking a connection
or used in combination with a retry mechanism, such as one in response
to Fast Connection Failover handling.
The setInvalid() method is used to identify connections that
are no longer suitable to be used in connection pooling. Once
setInvalid() is called on a connection, the connection will not
be returned to the pool instance upon close() but will instead be
physically closed and removed from the pool instance.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid()Indicates whether this connection is usable.voidIndicates that this connection is no longer valid for use.
-
Method Details
-
isValid
Indicates whether this connection is usable.This can be used for general checking purpose on a connection, or used in combination with a retry mechanism, such as one in response to Fast Connection Failover handling.
- Returns:
- A boolean indicating whether this connection is usable.
trueif so; otherwise,false. - Throws:
SQLException- If an error occurs.
-
setInvalid
Indicates that this connection is no longer valid for use.This method is used to identify connections that are no longer suitable to be used in connection pooling. Once it has been called on a connection, the connection is not returned to the pool instance upon
close()but is instead physically closed and removed from the pool instance.- Throws:
SQLException- If an error occurs.
-