Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to configure a TCP Keep-alive in JDBC connection string

User_9ET42Jan 13 2023

Hello,
I am using a JDBC connection string to connect to an oracle database, I am having idle connections because the response time is greater than 350 seg. therefore I am trying to add in the JDBC connection new network parameters but in my test identified that I have not sent a keep-alive packed I have doubts about the configuration, Could you help me with an example ?
My JDBC connection:
jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.4.50)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=GTRPRSVCOS)))
New parameters:
ENABLE=BROKEN, SO_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT
jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.4.50)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=GTRPRSVCOS))(ENABLE=BROKEN)(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))
I appreciate your help,

Comments

Post Details

Added on Jan 13 2023
2 comments
12,867 views