tessykandy
全部博文(42)
JAVA(4)
Shell(2)
C(3)
Python(4)
Ubuntu(6)
Windows(4)
LINUX(7)
Mysql(4)
Oracle(3)
2010年(4)
2009年(38)
liheying
有一天你
南瓜哥V
oracle_l
Cloud_Ro
水手228
txnet
kananos
zhouyf60
分类: Python/Ruby
2009-05-08 13:22:27
#!/usr/bin/python import cx_Oracleimport sys db = "orcl"user = "test"passwd = "123456" try: my_conn = cx_Oracle.connect(user,passwd,db) my_cursor = my_conn.cursor()except: sys.stderr.write("create connection to oralce error\n") sys.exit() try: my_cursor.execute("select name from user") result = my_cursor.fetchall() for row in result: print str(row[0])except: sys.stderr.write("execute sql error\n")finally: my_cursor.close() my_conn.close()
上一篇:C语言静态库和动态库编写
下一篇:Http之Get/Post请求区别
登录 注册