db.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PythonDBAGraphs 作者: bobbydurrett 项目源码 文件源码
def __init__(self,username,password,database):
        """ Login to database and open cursor """
        connect_string = username+'/'+password+'@'+database
        try:
            self.con = cx_Oracle.connect(connect_string)
        except cx_Oracle.DatabaseError as e:
            print("Error logging in: "+str(e.args[0]))
            print("Username: "+username)
            print("Password: "+password)
            print("Database: "+database)
            sys.exit(-1)
        self.cur = self.con.cursor()
        self.column_names=[]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号