From: Jon T. <jon...@gm...> - 2008-02-08 12:31:55
|
I hope this is relevant. Here's a wrapper that I use to connect from windows to windows DB2 7.2, DB2 8.2, DB2 9.1 and linux DB2 9.1. You can use the catalog name for the dns name, or you can use a special DNSString. As you can see you could use that DNSString to specify port and protocol as well def Connection(self, autoCommit = False): import DB2 import config db_name, db_host, db_username, db_password = config.get_db_parameters() if db_host: DNSString = "Provider=IBMDADB2;Database=%s;Hostname=%s;Protocol=TCPIP;Port=50000;" % (db_name, db_host) else: DNSString = db_name logging.debug(DNSString) return DB2.connect(DNSString, uid=db_username, pwd=db_password, autoCommit=autoCommit) On 2007-05-04 09:43 Jeremy M. Jones <zanesdad@be...> wrote >connect() method. It seems that dsn should be the hostname, uid should >be the user id, and pwd should be the password. But somewhere I read >that some option in the dsn should be a catalog name if you're |