我正在尝试使用 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] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@3d1a70a7 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)