Python的连接池 - Python DBUtils

jopen 11年前

Python DBUtils 提供了稳固的、持久的到数据库的连接池,支持多线程应用环境。

该项目支持 DB-API 2 兼容数据库接口以及传统的 PyGreSQL 接口。下图是 DB-API 2 的接口结构图

Python的连接池 - Python DBUtils

下面是连接的结构图:

Python的连接池 - Python DBUtils

使用实例代码:

import pgdb # import used DB-API 2 module  from DBUtils.PersistentDB import PersistentDB  persist = PersistentDB(pgdb, 1000, database='mydb')  db = persist.connection()

项目主页:http://www.open-open.com/lib/view/home/1350479565867