python 连接oracle

import cx_Oracle
map1={}
map2={}
con= cx_Oracle.connect("admin/admin@ssx")
cursor=con.cursor()
cursor.execute('select *  from test1')
rows = cursor.fetchall()
print rows
for x,y,z,m in rows :
  print x
  print y
  print z
  print m
  map1[x]=y
  key=','.join([str(x),str(y),str(z),str(m)])
  map2[y]=key
print map1
print map2
cursor.close()
con.close()

 

test1表里的数据如下

 

 

posted @ 2013-12-02 16:23  沙漠里的小鱼  阅读(229)  评论(0编辑  收藏  举报