使用cx_Oracle 创建会话池sessionpool 及使用

本文介绍了如何使用Python的cx_Oracle库创建会话池SessionPool,适用于频繁快速建立数据库连接的场景,如Web服务器。通过SessionPool获取连接对象,提升效率。并提供了官方文档和代码示例作为参考。
摘要由CSDN通过智能技术生成

参考其他文章:https://blog.csdn.net/danevc/article/details/54966443


参考官网文章:http://cx-oracle.readthedocs.io/en/latest/module.html#cx_Oracle.SessionPool


按照官网的思路比较好:

使用cx_Oracle.SessionPool 返回一个会话池对象,这个对象调用 acquire()就可以返回一个连接对象了。

Create and return a session pool object. Thisallows for very fast connections to the database and is of primary use in aserver where the same connection is being made mu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值