zoukankan      html  css  js  c++  java
  • Oracle调用存储过程返回游标结果

    /**
    1
    */
    public ResultSet queryForAllJSD_NEWEST(final String hpCode, final String id) {
    System.out.println("hpCode:"+hpCode+",id:"+id);
    ResultSet rs = (ResultSet)this.jdbctemplate.execute("{call pro_querybcb_newest(? , ? ,?)}" , new CallableStatementCallback(){
    public Object doInCallableStatement(CallableStatement cs)
    throws SQLException, DataAccessException {
    cs.setString(1, hpCode) ;
    cs.setString(2, id) ;
    cs.registerOutParameter(3, oracle.jdbc.OracleTypes.CURSOR);
    cs.execute();
    return cs.getObject(3);
    }
    });
    return rs;
    }

    /**
    2
    */
    public Map getMzJsData1(String hpCode,String id) throws IOException,
    SQLException, JSONException {
    System.out.println("========pro_querybcb_newest=============flag=AAA======");
    System.out.println("hpCode[" + hpCode + "],id[" + id + "]");
    Object hlzh = "";
    ResultSet rs = dao1.queryForAllJSD_NEWEST(hpCode, id);
    Map map = new HashMap();
    Map m=(Map) dao.checkMzObj(hpCode, id).get(0);
    map.put("groupid", m.get("ONE_MZ01_010"));
    map.put("hosid", m.get("ONE_MZ01_011"));
    map.put("subsection", m.get("ONE_MZ01_016"));
    JSONObject jss = null;
    try {
    if (rs.next()) {
    ResultSetMetaData rsmd = rs.getMetaData();
    int i = rsmd.getColumnCount();
    System.out.println("i=" + i);
    for (int j = 1; j <= i; j++) {
    map.put(rsmd.getColumnName(j),rs.getString(j) == null ? "" : rs.getString(j));
    }
    hlzh = dao1.getAreaName(id);
    map.put("areaName", hlzh == null ? "" : hlzh.toString());

    }
    } finally {
    if (rs != null) {
    try {
    rs.close();
    } catch (SQLException e) {
    }
    }
    }
    return map;
    }


    /**
    3
    */

    Map md=getMzJsData1(h.getHpCode(),map.get("ZYDJLSCODE").toString());

    if(md!=null){
    map.put("groupid", md.get("groupid"));
    map.put("hosid", md.get("hosid"));
    map.put("name", md.get("A4"));
    map.put("idno", md.get("A7"));
    map.put("Indate", md.get("A16"));
    map.put("outdate", md.get("A17"));
    map.put("hosno", md.get("A15"));
    map.put("sick", md.get("A24"));
    }

  • 相关阅读:
    UITableView移除某行的分割线和让分割线宽度为cell的宽度
    UIButton防止被重复点击
    给View添加手势,防止点击View上其他视图触发点击效果
    自定义导航栏返回时的滑动手势处理
    一个UITableViewCell的简单动画效果
    二维码扫描
    代理的使用
    常用网站
    IOS 自定义View X系列出现一条线条
    UILabel自适应文本,让文本自适应
  • 原文地址:https://www.cnblogs.com/fkeyta/p/12129219.html
Copyright © 2011-2022 走看看