一,在安装的时候,参数有点不一样:
python setup.py build install
二,连接数据库,有两种方式,DSN和TNSNAMES方式:
#dsn = orcl.makedsn(self.oracle_host, self.oracle_port, self.oracle_sid) #con = orcl.connect(self.oracle_username, self.oracle_password, dsn) con = orcl.connect(self.oracle_username,self.oracle_password,self.oracle_alarm_ciname) cursor = con.cursor() sql = "select '%s' from dual" % (test_str,) cursor.execute(sql); result = cursor.fetchall() cursor.close() con.close()
三,检测数据库是否正常的语句如下:
select 'OK' from dual