1
我正嘗試使用jaydebeapi包連接到teradata數據庫。jaydebeapi teradata連接
conn = jaydebeapi.connect('com.teradata.jdbc.TeraDriver',
['jdbc:teradata://ip/TMODE=ANSI,CHARSET=utf8', 'username', 'password'],
['/teradata/tdgssconfig.jar',
'/terajdbc4.jar'])
錯誤而執行:
TERAJDBC4 ERROR [main] [email protected] Connection to <ip_address> Wed Oct 07 13:47:29 IST 2015 socket orig=<ip_address> cid=22f79598 sess=0 java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$ConnectThread.run(TDNetworkIOIF.java:1216)
Traceback (most recent call last):
File "test_teradata.py", line 32, in <module>
teradataconn()
File "test_teradata.py", line 26, in teradataconn
'/home/abhishek/git/dblore/code/lib/teradata/terajdbc4.jar'])
File "/usr/local/lib/python2.7/dist-packages/jaydebeapi/__init__.py", line 359, in connect
jconn = _jdbc_connect(jclassname, jars, libs, *driver_args)
File "/usr/local/lib/python2.7/dist-packages/jaydebeapi/__init__.py", line 183, in _jdbc_connect_jpype
return jpype.java.sql.DriverManager.getConnection(*driver_args)
jpype._jexception.SQLExceptionPyRaisable: java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.00.00.20] [Error 1277] [SQLState 08S01] Login timeout for Connection to <ip_address> Wed Oct 07 13:47:29 IST 2015 socket orig=<ip_address> cid=22f79598 sess=0 java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$ConnectThread.run(TDNetworkIOIF.java:1216)
「SocketTimeoutException:連接超時」沒有ip服務器,或它沒有及時響應(例如,因爲防火牆或其他網絡問題) –
我能夠通過Java連接到數據庫使用相同的JDBC驅動程序和參數。 – Abhi