Created
January 8, 2019 02:46
-
-
Save Xifeng2009/269bb59ccea8f07bfee03668a8fec8f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cx_Oracle #引用模块cx_Oracle | |
conn=cx_Oracle.connect('load/123456@localhost/ora11g') #连接数据库 | |
c=conn.cursor() #获取cursor | |
x=c.execute('select sysdate from dual') #使用cursor进行各种操作 | |
x.fetchone() | |
c.close() #关闭cursor | |
conn.close() #关闭连接 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment