def get_connect(self):
db = cx_Oracle.connect(self.username, self.password, self.host_string)
# print db.version
# versioning = db.version.split('.')
# if versioning[0] == '10':
# print "Running 10g"
# elif versioning[0] == '9':
# print "Running 9i"
# print db.dsn
# sql = 'SELECT * FROM' + self.table_name
# # cursor.execute('SELECT * FROM %s',str)
# cursor.execute(sql)
# # pprint(cursor.fetchall())
#
# # for row in cursor: ## notice that this is plain English!
# # print row
#
# column_data_types = cursor.execute('SELECT * FROM ADP_D_HOST')
#
# print column_data_types
#
# pprint(cursor.description)
return db.cursor()
评论列表
文章目录