Python之cx_Oracle操作Oracle数据库

Python之cx_Oracle操作Oracle数据库

#encoding=utf-8
import MySQLdb
import cx_Oracle

orcon = cx_Oracle.connect("username", "password", "172.29.131.25:1521/orcl")
orcursor = orcon.cursor()
orcursor.execute("select columnname from tablename ")
row=orcursor.fetchall()
for r in row:
    for cell in r:
        print cell
orcursor.close()
orcon.close()

你可能感兴趣的:(Python之cx_Oracle操作Oracle数据库)