没太写过phthon访问DB2的程序。不过从API文档上看,是提供了close方法的。
https://github.com/ibmdb/python-ibmdb/wiki/APIs#ibm_dbclose
bool ibm_db.close ( IBM_DBConnection connection )
Description
Closes a DB2 client connection and returns the corresponding resources to the database server.
If you attempt to close a persistent DB2 client connection created with ibm_db.pconnect(), the connection is returned to the pool for the next caller of ibm_db.pconnect() to use.
Parameters
connection - A valid IBM_DBConnectionReturn Values
Returns True on success or False on failure.
收起