Oracle JDBC Driver Does not use the IPV6 by Default
(Doc ID 3049389.1)
Last updated on SEPTEMBER 27, 2024
Applies to:
JDBC - Version 21.10 and laterInformation in this document applies to any platform.
Goal
A Linux OS is configured with a dual IP stack (IPv6/IPv4). It was observed that the Java applications connect to the database via IPv4 or IPv6, seemingly randomly. The expected behavior is that, as both sides client and server have IPv6, the connection will use IPv6 as the preferred protocol.
The native OS tools (nc, curl, etc.) were checked to consistently use IPv6 when trying to connect to the database using the scan database host name. However, this doesn't seem to be the behavior for the Oracle JDBC driver.
Why doesn't the Oracle driver use IPv6 consistently when the connection string contains the scan hostname?
When the JDBC connection string is changed to use the IPv6 address directly as the following:
url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=[0000:f000:00a:0000:d1d2:1a2b:1e00:1a00])(PORT=<port>)))(CONNECT_DATA=(SERVICE_NAME=<service-name>)))
then all connections are successful using IPv6.
Solution
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Goal |
Solution |