PySQLPool - Python 的 MySQL 连接池
LGPL
跨平台
Python
软件简介
PySQLPool 是 Python 的 MySQL 数据库连接池开发库,使用 MySQLDB Python 包。PySQLPool 其中一部分时
MySQL Query 类,用来处理所有线程安装的连接锁、连接管理和游标管理。使用 PySQLPool 我们需要做的仅仅是编写 SQL 语句并执行。
示例代码:
import PySQLPool
import threading
connection = PySQLPool.getNewConnection(username='root', password='123456', host='localhost', db='mydb')
class MyThread(threading.thread):
def __init__(self):
...
def run(self):
query = PySQLPool.getNewQuery(connection)
query.Query('insert into table ('column') values ('1')')