public 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.
Modifier and Type | Method and Description |
---|---|
boolean |
isValid()
Indicates whether this connection is usable.
|
void |
setInvalid()
Indicates that this connection is no longer valid for use.
|
boolean isValid() throws java.sql.SQLException
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.
true
if so; otherwise, false
.java.sql.SQLException
- If an error occurs.void setInvalid() throws java.sql.SQLException
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.
java.sql.SQLException
- If an error occurs.