有人知道如何使用遠程DB2服務器在Linux上運行Web2py?Web2py與DB2一起工作
我試着用pyodbc,但非常差超過它
我無法找到一個步步指南的文檔。
我的配置文件:
ODBCINST.INI:
[DB2]
Description = DB2 Driver
Driver = /opt/odbc_cli/clidriver/lib/libdb2.so
FileUsage = 1
DontDLClose = 1
ODBC.INI
[test]
Description = Test to DB2
Driver = DB2
嘗試連接:
>>> import pyodbc
>>> cnxn = pyodbc.connect('DRIVER={DB2};SERVER=172.16.1.35;DATABASE=log10;UID=db2admin;PWD=passs')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyodbc.Error: ('08001', '[08001] [unixODBC][IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "127.0.0.1". Communication function detecting the error: "connect". Protocol specific error code(s): "111", "*", "*". SQLSTATE=08001\n (-30081) (SQLDriverConnect)')
我缺少什麼? 在此先感謝
基督教
您有沒有使用DAL的原因? http://web2py.com/books/default/chapter/29/06 – korylprince
即時通訊使用Web2py DAL,但它沒有直接的Db連接,而是你需要f/e pyodbc這個 – chespinoza
所以使用連接字符串「db2: //用戶名:密碼@測試「不起作用? – korylprince