欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python鏈接Oracle數(shù)據(jù)庫(kù)的方法

 更新時(shí)間:2015年06月28日 17:35:20   作者:秋風(fēng)秋雨  
這篇文章主要介紹了python鏈接Oracle數(shù)據(jù)庫(kù)的方法,實(shí)例分析了Python使用cx_Oracle模塊操作Oracle數(shù)據(jù)庫(kù)的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了python鏈接Oracle數(shù)據(jù)庫(kù)的方法。分享給大家供大家參考。具體如下:

這里使用python鏈接Oracle數(shù)據(jù)庫(kù)需要引用cx_Oracle庫(kù)

#coding=UTF-8
  import cx_Oracle
  def hello():
    '''Hello cx_Oracle示例:
    1)打印數(shù)據(jù)庫(kù)版本信息.
    2)查詢表數(shù)據(jù).'''
    conn = cx_Oracle.connect("obs61","obs61","tx8i.hp")
    cur = conn.cursor()
    try:
      print "Oracle Version:%s" % conn.version
      print "Table SUB_POLICY rows:"
      cur.execute('select * from wlan_future_event')
      for row in cur:
        print row
    finally:
      cur.close()
      conn.close()
  hello()

希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論