import jaydebeapi
for i in range(10): try: url = ###### user = ##### password = ##### dirver = 'com.informix.jdbc.IfxDriver' jarFile = "D:\\informix\ifxjdbc.jar" # 需要安装java的环境,驱动:ifxjdbc.jar conn = jaydebeapi.connect(dirver, url, [user, password], jarFile) # 创建游标对象 self.curs = conn.cursor() logging.info('informix数据库连接成功') break except Exception as e: print("连接informixCB数据库异常!!!", "错误信息:", e) logging.info("连接informixCB数据库异常!!!", "错误信息:", e)
标签:python,数据库,jar,informix,ifxjdbc,xiformix,连接,conn From: https://www.cnblogs.com/xujunhui/p/17346689.html