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.

Regarding DNS lookup for jdbc for Http Proxy

868706Aug 20 2024

Hi team,
I am facing an issue when trying to connect to oracle database. The oracle database TCP connection tunneled through Http proxy. Here, I am trying to connect to database and do not have access directly via internet. When I try to use JDBC thin driver to connect using tcps connection as mentioned in Doc : https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/data-sources-and-URLs.html#GUID-8D0ADAE6-B8EF-4E02-85E3-15C2509ACBD8 .

The issue is the driver default implementation consists of a DNS lookup before connecting to the proxy instead of relying on the DNS resolver of the proxy.

oracle.net.nt.TcpNTAdapter#connect

public void connect() throws IOException {

String var1 = (String)this.socketOptions.get(2);

boolean var2 = Boolean.parseBoolean((String)this.socketOptions.get(18));

if (this.inetAddresses == null) {

        **this.inetAddresses = InetAddress.getAllByName(this.host);**
        if (var2 && this.inetAddresses.length > 1) { 

                this.inetAddresses = getAddressesInCircularOrder(this.host, this.inetAddresses); 

        }

        DownHostsCache.getInstance().reorderAddresses(this.inetAddresses, this.port); this.attempts = this.inetAddresses.length; this.count = 0; 

}

Do we have any way to skip this host name resolution and let proxy server do the resolution of hostname or any workaround for it.

Comments
Post Details
Added on Aug 20 2024
0 comments
41 views