当前位置: 首页>>代码示例>>Python>>正文


Python cx_Oracle.InterfaceError方法代码示例

本文整理汇总了Python中cx_Oracle.InterfaceError方法的典型用法代码示例。如果您正苦于以下问题:Python cx_Oracle.InterfaceError方法的具体用法?Python cx_Oracle.InterfaceError怎么用?Python cx_Oracle.InterfaceError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cx_Oracle的用法示例。


在下文中一共展示了cx_Oracle.InterfaceError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connect

# 需要导入模块: import cx_Oracle [as 别名]
# 或者: from cx_Oracle import InterfaceError [as 别名]
def connect(self):
        self.initConnection()
        self.__dsn = cx_Oracle.makedsn(self.hostname, self.port, self.db)
        self.__dsn = utf8encode(self.__dsn)
        self.user = utf8encode(self.user)
        self.password = utf8encode(self.password)

        try:
            self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password, mode=cx_Oracle.SYSDBA)
            logger.info("successfully connected as SYSDBA")
        except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError), ex:
            if "Oracle Client library" in str(ex):
                msg = re.sub(r"DPI-\d+:\s+", "", str(ex))
                msg = re.sub(r': ("[^"]+")', r" (\g<1>)", msg)
                msg = re.sub(r". See (http[^ ]+)", r'. See "\g<1>"', msg)
                raise SqlmapConnectionException(msg)

            try:
                self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password)
            except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError), msg:
                raise SqlmapConnectionException(msg) 
开发者ID:sabri-zaki,项目名称:EasY_HaCk,代码行数:23,代码来源:connector.py

示例2: close

# 需要导入模块: import cx_Oracle [as 别名]
# 或者: from cx_Oracle import InterfaceError [as 别名]
def close(self):
        try:
            self.cursor.close()
        except Database.InterfaceError:
            # already closed
            pass 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:8,代码来源:base.py

示例3: connect

# 需要导入模块: import cx_Oracle [as 别名]
# 或者: from cx_Oracle import InterfaceError [as 别名]
def connect(self):
        self.initConnection()
        self.__dsn = cx_Oracle.makedsn(self.hostname, self.port, self.db)
        self.__dsn = utf8encode(self.__dsn)
        self.user = utf8encode(self.user)
        self.password = utf8encode(self.password)

        try:
            self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password, mode=cx_Oracle.SYSDBA)
            logger.info("successfully connected as SYSDBA")
        except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError):
            try:
                self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password)
            except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError), msg:
                raise SqlmapConnectionException(msg) 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:17,代码来源:connector.py

示例4: fetchall

# 需要导入模块: import cx_Oracle [as 别名]
# 或者: from cx_Oracle import InterfaceError [as 别名]
def fetchall(self):
        try:
            return self.cursor.fetchall()
        except cx_Oracle.InterfaceError, msg:
            logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
            return None 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:8,代码来源:connector.py


注:本文中的cx_Oracle.InterfaceError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。