首页 新闻 会员 周边

java应该很简单,但是在网上没找到

0
悬赏园豆:10 [待解决问题]

ReportModelVOImpl bForm = (ReportModelVOImpl) baseForm;
  List<ReportModelVOImpl> list = new ArrayList<ReportModelVOImpl>();
  Connection conn=null;
  ResultSet rs=null;
  CallableStatement cs=null;
  
  try {
   String sqlStr="{call ls_report_util_pkg.product_info_report(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
   conn=DataBaseUtil.getConnection();
   cs=conn.prepareCall(sqlStr);
   //输出列表
   cs.registerOutParameter(1, OracleTypes.CURSOR);
   //输出总行数
   cs.registerOutParameter(2, OracleTypes.NUMBER);
   //开始行数
   cs.setInt(3,bForm.getStartPos());
   //结束行数
   cs.setInt(4,bForm.getRowCount()+bForm.getStartPos());
   //创建时间
   cs.setString(5,q_1);
   //
   cs.setString(6,q_2);
   //
   cs.setString(7,q_3);
   //
   cs.setString(8,q_4);
   //
   cs.setString(9,q_5);
   //
   cs.setString(10,q_6);
   //
   cs.setString(11,q_7);
   //
   cs.setString(12,q_8);
   //
   cs.setString(13,q_9);
   //
   cs.setString(14,q_10);
   //
   cs.setString(15,q_11);
   //
   cs.setString(16,q_12);
   //
   cs.setString(17,q_13);
   //
   cs.setString(18,q_14);
   //
   cs.setString(19,q_15);
   //
   cs.setString(20,q_16);
   cs.execute();
   list = initListInfo(cs,rs);
   //耦合?
   bForm.setTotalCount(cs.getInt(2));
   request.setAttribute("BaseForm",bForm);
  } catch (SQLException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }finally{
   if(rs != null){
    try {
     rs.close();
    } catch (SQLException e) {
     log.error(e);
     e.printStackTrace();
    }   
   }
    if(cs !=null){
     try {
     cs.close();
    } catch (SQLException e) {
     log.error(e);
     e.printStackTrace();
    }
    }
    if(conn !=null){
     try {
     conn.close();
    } catch (SQLException e) {
     log.error(e);
     e.printStackTrace();
    }
    }
  }
   return list;

 

bForm.setTotalCount(cs.getInt(2));这句是什么意思?

咫尺~天涯的主页 咫尺~天涯 | 初学一级 | 园豆:8
提问于:2016-09-14 15:47
< >
分享
所有回答(3)
0

没有上下文就这一句无头无脑的.是找算命的吗...

吴瑞祥 | 园豆:29449 (高人七级) | 2016-09-14 16:10
0

这么个问法,只能说,cs.getInt(2)返回了一个东西(看意思应该是int类型),然后调用bForm.setTotalCount方法传了过去。。。

顾晓北 | 园豆:10844 (专家六级) | 2016-09-18 14:58
0

问题自己问公司大神解决了

 

咫尺~天涯 | 园豆:8 (初学一级) | 2016-10-18 16:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册