query_str = 'SELECT COUNT(*) FROM table_name'
conn = ibm_db.pconnect('dsn=write', 'usrname', 'secret')
query_stmt = ibm_db.prepare(conn, query_str)
ibm_db.execute(query_stmt)
How to connect python to db2