DB2 connection through pyodbc and pandas.io.sql in Unix Box with non-root

落爺英雄遲暮 提交于 2020-01-25 04:38:07

问题


I am trying to connect to IBM DB2 through python using pyodbc and pandas.io.sql, now the twist is I am not Super User or better to say I dont have any right to install DB2 Driver or anything else.

Is it possible to use pyodbc and pandas.io.sql to connect to DB2 with such conditions.

The code which I used so far is

cnxn = pyodbc.connect('Driver={FreeTDS}; Hostname=eee;Port=25369;Protocol=TCPIP;Database=rt;CurrentSchema=abc;UID=abc;PWD=efg;')

Error

pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')

Or is it possible to check if there is preinstalled DB2 driver.


回答1:


At a minimum you need the IBM Data Server Driver for ODBC and CLI. You don't need to be root to install it, it's just a bunch of libraries. Find the correct version here: http://www-01.ibm.com/support/docview.wss?uid=swg24033997



来源:https://stackoverflow.com/questions/17891797/db2-connection-through-pyodbc-and-pandas-io-sql-in-unix-box-with-non-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!