8.2.25 isValid(int timeout)
- Organization of this subsection
(1) Function
This method acquires the current connection status.
(2) Format
public synchronized boolean isValid(int timeout) throws SQLException
(3) Arguments
- int timeout
-
Specifies the wait time (in seconds), in the range from 0 to 65,535.
If zero is specified, there will be no limit to the wait time.
If 65,536 or a greater value is specified, 65,535 is assumed.
(4) Return value
If the method verifies that the connection is alive, it returns true. If the Connection object is closed, or if the wait time specified in the argument has expired and a timeout has occurred, the method returns false.
(5) Exceptions
If -1 or a smaller value is specified in the argument, the JDBC driver throws an SQLException.