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"));
    }

  • 相关阅读:
    移动函数的封装示例
    如何从不均衡类中进行机器学习
    DPM(Deformable Parts Model)--原理(一)
    K-means聚类算法
    机器学习中对核函数的理解
    总结:Bias(偏差),Error(误差),Variance(方差)及CV(交叉验证)
    技术干货
    神经网络入门
    目标函数、损失函数、代价函数
    地铁客流检测训练问题记录
  • 原文地址:https://www.cnblogs.com/fkeyta/p/12129219.html
Copyright © 2011-2022 走看看