Exemplo n.º 1
0
 def _getDB2CliDS(self, sql,bv=[], po='SEL'):
     self.log.debug('qry = %s' % sql)
     cs = getDSConnStr('DB2CLI', self.ib.user, self.ib.pwd, self.ib.dsn, self.ib.db)
     dbh = DBOracle(cs, self.log)
     rc  = dbh.connToDB ()
     if rc != 0 :
         self.log.error('Could not connect to the DB rc = %s ' % rc)
         return None
      
     if po == 'SEL': r = dbh.runQry(sql)
     else          : r = dbh.exeQry(sql,bv)
     dbh.closeDBConn()
     return r        
Exemplo n.º 2
0
 def connToDB(self):
     
     r = 1
     sql = 'select SYSDATE from dual'
     cs = getDSConnStr('ORADB',self.ib.db_user,self.ib.db_pwd,self.ib.db_name)
     self.logger.debug('qry = %s\nCS =%s ' % (sql,cs))
     dbh = DBOracle(cs,self.logger)
     if dbh.connToDB() != 0 : return r
     
     rs = dbh.runQry(sql)
     if rs is not None and type(rs) == list :  
         r = 0
         self.logger.debug("rs = %s" % rs[0][0])
     
     dbh.closeDBConn()
     return r
Exemplo n.º 3
0
def getFldWklInfaRepo(connStr,log):
    rs = None
    db = DBOracle(connStr,'')
    re = db.connToDB()
    if (re != 0 ) : return rs 
 
    tr = []
    rs = db.runQry(dbi.DBInfaRepo.selRepWflQry)
    for r in rs:
        b = ib.InfaWFBean() 
        b.setInfaWFBean(r,getIDX(dbi.DBInfaRepo.selRepWflIdx))
        log.debug("r = %s lb = %s" % (r,b))
        tr.append(b)
    
    db.closeDBConn()
                     
    return tr