Using DB2 with Python

Download the package
pip install ibm_db

Import the module
        import ibm_db

Connect to a local or cataloged database
cn = ibm_db.connect("database","username","password")

Connect to an uncataloged database
cn=ibm_db.connect("DATABASE=name;HOSTNAME=host;PORT=60000;PROTOCOL=TCPIP;UID=username;
                PWD=password;", "", "")



Comments

Popular posts from this blog

Converting Excel File to JSON File using xlrd module

Using Oracle with Python

Using time module