import cx_Oracle
oraPool=cx_Oracle.SessionPool(user='crystal',password='crystal',dsn='10.14.250.29/oratest',min=1,max=500,increment=1)
def oraConn(oraSql):
conn=oraPool.acquire()
cursor=conn.cursor()
try:
cursor.execute(oraSql)
cursor.execute('commit')
return 'Execute %s is successfule'%oraSql
cursor.close()
oraPool.release()
except cx_Oracle.Error,e:
return e
if __name__=='__main__':
fileName=open('d:\\zx_addcash.txt','r')
for oraSql in fileName:
a=oraConn(oraSql)
print a