楼主: shadowaver
892 2

[IBM数据库与大数据解决方案] python连接oracle数据库的新模块 [推广有奖]

随心所欲不逾矩

已卖:1243份资源

教授

56%

还不是VIP/贵宾

-

威望
0
论坛币
8309 个
通用积分
689.8825
学术水平
18 点
热心指数
22 点
信用等级
13 点
经验
29709 点
帖子
890
精华
0
在线时间
1375 小时
注册时间
2007-9-27
最后登录
2026-1-22

楼主
shadowaver 在职认证  发表于 2024-6-17 10:30:49 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
python连接oracle数据库的新模块
从原来的cx_Oralce更新为oracldb
cx_Oracle has a major new release under a new name and homepagepython-oracledb.
New projects should install python-oracledb instead of cx_Oracle.
https://python-oracledb.readthedocs.io/en/latest/user_guide/installation.html
https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_c.html#upgrading83


使用方法:
import oracledb

You must replace positional parameters with keyword parameters, unlessonly one parameter is being passed. Python-oracledb uses keyword parametersexclusively unless a DSN containing the user, password, and connect stringcombined, for example un/pw@cs, is used. This change makes the drivercompliant with the Python Database API specification PEP 249.
For example, the following code will fail:
c = oracledb.connect("un", "pw", "cs")

and needs to be changed to:
c = oracledb.connect(user="un", password="pw", dsn="cs")

The following example will continue to work without change:
c = oracledb.connect("un/pw@cs")

eg:
c=oracledb.connect('user/pwd@192.168.1.1:1521/your_db_name')





二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Oracle python CLE ACL 数据库 python连接oracle数据库的新模块

shadowaver@163.com
QQ 540722048

沙发
HappyAndy_Lo 发表于 2024-6-19 08:58:39
Well Done! Girl!

藤椅
albertwishedu 发表于 2024-6-19 08:59:12

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-28 04:25