| 查看: 189 | 回复: 0 | ||
| 当前主题已经存档。 | ||
[资源]
python连接oracle数据库的动态库-cx_oracle
|
||
|
python连接oracle数据库的动态库-cx_oracle python连接oracle数据库的动态库的下载地址 http://www.python.net/crew/atuining/cx_Oracle/ 这是一段测试小程序: import cx_Oracle connection = cx_Oracle.connect("用户名", "密码", "数据库" ![]() cursor = connection.cursor() cursor.arraysize = 15 cursor.execute("""select fnxh,fcjym,fcjymc from tryxrz""" ![]() for fnxh,fcjym,fcjymc in cursor.fetchall(): print str(fnxh)+" "+str(fcjym)+" "+str(fcjymc) 在python2.5+cx_oracle3.4.1+oracle9.2上测试通过. python调用cx_Oracle开发(-)---cx_Oracle安装 上面是windows的,接下来是linux的,是转的别人的帖子,原帖地址在这里 http://blog.csdn.net/LIUYANG007/archive/2007/03/16/1531167.aspx 开始在ubuntu下用python调用oracle,决定使用cx_Oracle. 安装前要确定oracle安装成功并能正常使用 在cx_Oracle的网站上http://www.python.net/crew/atuining/cx_Oracle/ 有windows和linux 2种安装版本 按照自己的具体配置选择下载版本,我是oracle10,python 2.4 下载Fedora Core 5 RPM (Oracle 10g, Python 2.4), cx_Oracle-4.3-10g-py24-1.i386.rpm 先把rpm转换成deb安装 suod alien cx_Oracle-4.3-10g-py24-1.i386.rpm cx_Oracle-4.3-10g-py24-1.i386.deb 再安装deb sudo dpkg -i cx_Oracle-4.3-10g-py24-1.i386.deb 安装完成后在python里输入 >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ? ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory 经过查找发现是oracle的路径没有设置 输入: locate libclntsh.so.10.1 获取对于路径 /app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1 编辑/etc/ld.so.conf sudo gedit /etc/ld.so.conf 在最后一行输入获取的路径 /app/oracle/oracle/product/10.2.0/db_1/lib/ 保存,关闭gedit 执行 ldconfig 再调用就好了 |
» 猜你喜欢
filecode
已经有3人回复
我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人
已经有10人回复
静等基金结果
已经有13人回复
关于Filecode分析方法
已经有3人回复
国自然结果
已经有8人回复
FileCode能看出啥?
已经有8人回复
应该是93bebmhtak前后十一个字符比较关键
已经有22人回复
奇怪,两个人的filecode固定段从头到尾一模一样
已经有4人回复
8月时间戳变的,举个手。玩一下,释放压力
已经有13人回复
好奇怪的filecode
已经有5人回复











回复此楼
100