title: pyodbc connection to DB2
body: <p>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 .</p>
  
  <p>The code which I am using is :</p>
  
  <pre><code>cnx = pyodbc.connect(
          'Driver={IBM DB2 ODBC Driver}; '
          'Hostname=hostname; '
          'Port=50100; '
          'Protocol=TCPIP; '
          'Database=db_name; '
          'CurrentSchema=schema; '
          'UID=user_id; '
          'PWD = passw;'
          )
  </code></pre>
  
  <p>Not sure how to connect this with the drivers and CLI I just downloaded and any hint will be very helpful.</p>
  
  <p>This question is related :</p>
  
  <p><a href="https://stackoverflow.com/questions/17891797/db2-connection-through-pyodbc-and-pandas-io-sql-in-unix-box-with-non-root">DB2 connection through pyodbc and pandas.io.sql in Unix Box with non-root</a></p>