Teradata JDBC Driver Connection Through Socks Proxy

Tools & Utilities
Enthusiast

Teradata JDBC Driver Connection Through Socks Proxy

We are trying to connect to a Teradata database instance through a Socks proxy using the JDBC driver on a private network. However, the JDBC driver can’t resolve the host name, only the Socks proxy. Do you have any suggestions to get around this or have any native ways to handle this?

 

Here are some logs:

 

2019-06-27.19:25:00.376 TERAJDBC4 ERROR [pool-3-thread-1] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@23ea621a Connection to onzwqktfmmzc25ltmvzcumzufyzdcnboge3talrsgezsumrsfjwg6y3bnrug643.u.ssh.periscopedata.com Thu Jun 27 19:25:00 GMT 2019 socket orig=onzwqktfmmzc25ltmvzcumzufyzdcnboge3talrsgezsumrsfjwg6y3bnrug643.u.ssh.periscopedata.com cid=585f9ba5 sess=0 java.net.UnknownHostException: onzwqktfmmzc25ltmvzcumzufyzdcnboge3talrsgezsumrsfjwg6y3bnrug643.u.ssh.periscopedata.com  
  at java.net.InetAddress.getAllByName0(InetAddress.java:1280)  
  at java.net.InetAddress.getAllByName(InetAddress.java:1192)  
  at java.net.InetAddress.getAllByName(InetAddress.java:1126)  
  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.doLookup(TDNetworkIOIF.java:223)  
  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.getAddresses(TDNetworkIOIF.java:261)  
  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.connectToHost(TDNetworkIOIF.java:381)  
  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.createSocketConnection(TDNetworkIOIF.java:156)  
  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.<init>(TDNetworkIOIF.java:142)  
  at com.teradata.jdbc.jdbc.GenericTeradataConnection.getIO(GenericTeradataConnection.java:143)  
  at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:100)  
  at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:211)  
  at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:36)  
  at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructSQLConnection(JDK6ConnectionFactory.java:25)  
  at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:181)  
  at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:171)  
  at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:236)  
  at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:162)  
  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:112)  
  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:118)  
  at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:376)  
  at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:205)  
  at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:448)  
  at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:519)  
  at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:113)  
  at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72)  
  at io.periscope.tunneler.ConnectionManager.makeDBConnectionPool(ConnectionManager.java:232)  
  at io.periscope.tunneler.ConnectionManager.makeDBConnectionPool(ConnectionManager.java:202)  
  at io.periscope.tunneler.ConnectionManager.ensureConnectionPoolForKeyExists(ConnectionManager.java:164)  
  at io.periscope.tunneler.ConnectionManager.getDBConnection(ConnectionManager.java:84)  
  at io.periscope.tunneler.results.JdbcQueryExecutor.execute(JdbcQueryExecutor.java:111)  
  at io.periscope.tunneler.TunnelerServiceImpl.GetQueryResult(TunnelerServiceImpl.java:195)  
  at io.periscope.tunneler.ServiceDelegator.lambda$GetQueryResult$2(ServiceDelegator.java:67)  
  at io.periscope.tunneler.ServiceDelegator.executeWithTimer(ServiceDelegator.java:167)  
  at io.periscope.tunneler.ServiceDelegator.GetQueryResult(ServiceDelegator.java:64)  
  at io.periscope.tunneler.gen.TunnelerService$Processor$GetQueryResult.getResult(TunnelerService.java:713)  
  at io.periscope.tunneler.gen.TunnelerService$Processor$GetQueryResult.getResult(TunnelerService.java:698)  
  at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)  
  at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)  
  at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:225)  
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
  at java.lang.Thread.run(Thread.java:748)

We do not want the driver to resolve the host name "onzwqktfmmzc25ltmvzcumzufyzdcnboge3talrsgezsumrsfjwg6y3bnrug643.u.ssh.periscopedata.com" as our Socks Proxy instance will do the host name resolution. Any suggestions?

1 REPLY 1
Teradata Employee

Re: Teradata JDBC Driver Connection Through Socks Proxy

The Teradata JDBC Driver always performs a hostname lookup if a hostname is specified.

 

You must specify an IP address if you do not want the JDBC Driver to perform a hostname lookup.