python 连接 oracle的一个小

2023-01-31 05:01:38 python oracle 连接
#!/usr/bin/python
#conding=utf-8


#import module


import cx_oracle as oracle


db=oracle.connect('user/passWord@192.168.0.103:1521/orcl')
cursor=db.cursor()
cursor.execute("select * from student")
rs=cursor.fetchall()


for row in rs:
    print ('ID=%d,name=%s'%(row[0],row[1]))
cursor.close()


db.close()

相关文章