1

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.

LonelySoul
  • 1,212
  • 5
  • 18
  • 45

1 Answers1

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

mustaccio
  • 18,234
  • 16
  • 48
  • 57
  • Thanks @mustaccio... I am not sure about how to install it without root access.. can you please elaborate more on that... – LonelySoul Jul 28 '13 at 21:15
  • 1
    I'd start here: [http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.apdv.cli.doc/doc/t0023864.html](http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.apdv.cli.doc/doc/t0023864.html) – mustaccio Jul 29 '13 at 01:48
  • I did downloaded the DB2 driver and not sure how to connect it with python script ... any lead.....\ – LonelySoul Aug 02 '13 at 16:46