泛微带事物的RecordSetTrans

        RecordSetTrans rst = RecordSetTrans();
        rst.setAutoCommit(false);
        log.info("开始执行sql1");
        isSucc1 = rst.executeUpdate(sql1,tzje,"调整金额:"+tzje+"科目金额被调整到"+jsdzgs+" "+jsdzbm+" "+jsdzcbzx+" "+jsdzkm+" "+jsdzjd+"\r\n",nf,gs,bm,cbzx,km,jd); //扣掉科目预算
        log.info("开始执行sql2");
        isSucc2 = rst.executeUpdate(sql2,tzje,tzje,"调整金额:"+tzje+"接收调整科目金额"+gs+" "+bm+" "+cbzx+" "+km+" "+jd+"\r\n",nf,jsdzgs,jsdzbm,jsdzcbzx,jsdzkm,jsdzjd); //增加科目预算
        log.info("开始执行sql1");
        if (isSucc1&&isSucc2) {
            log.info("执行sql成功");
            rst.commit();
        }else {
            rst.rollback();
            this.log.info("预算调整错误 执行rs.execute(sql);:" +jsdzgs+" "+jsdzbm+" "+jsdzcbzx+" "+jsdzkm+" "+jsdzjd);  //日志记录
            this.log.info("预算被调整错误 执行rs.execute(sql);:"+gs+" "+bm+" "+cbzx+" "+km+" "+jd );  //
            return OAActonStatus.Failure.status;
        }

你可能感兴趣的:(java)