I am currently trying to connect DB2 from a python program using pyodbc. As the driver was not already installed in the server I downloaded it from the IBM website, but I'm not sure how to connect using pyodbc .
The code which I am using is :
cnx = pyodbc.connect(
'Driver={IBM DB2 ODBC Driver}; '
'Hostname=hostname; '
'Port=50100; '
'Protocol=TCPIP; '
'Database=db_name; '
'CurrentSchema=schema; '
'UID=user_id; '
'PWD = passw;'
)
Not sure how to connect this with the drivers and CLI I just downloaded and any hint will be very helpful.
This question is related :
DB2 connection through pyodbc and pandas.io.sql in Unix Box with non-root