The JDBC Client supports the TCPKeepAlive connection setting, which allows the TCP socket to keep an idle connection active by passing TCPKeepAlive packets from the client to the server and TCPKeepAlive acknowledgements from the server to the client.
Note: The process to enable TCPKeepAlive described in this section is valid at the time of publication. For latest information on the process, refer to the following links for your operating system:
The following steps describe how you can enable this feature for the following operating systems.
Windows:
1. Launch the registry and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
2. Create a KeepAliveInterval parameter of the REG_DWORD type with an interval value in milliseconds. For example, 10000 for 10 seconds.
3. Create a KeepAliveTime parameter of the REG_DWORD type with the number of milliseconds to wait before resending a KeepAlive packet. For example, 3600000 for 1 hour.
4. Restart the operating system.
Linux:
1. Set the time interval between the probes using the following command from the root account:
2. Set the maximum number of probes using the following command:
ndd -set /dev/tcp tcp_keepalive_kill probe_value
3. Restart the operating system.
AIX:
1. Set the KeepAlive interval value using the following command from the root account:
no -o tcp_keepidle=interval_value
2. Set the interval between KeepAlive packets to maintain a connection using the following command:
no -o tcp_keepintvl=interval_value
3. Restart the operating system.
Note: To permanently change the values for AIX, HP-UX, Solaris, and Linux, set the values while the system is starting by modifying the startup script.