sqlserver 存储过程 返回多个select 结果集
sql server 数据库的存储过程 ? ALTER PROCEDURE?[prc_******]? select? * from? a select * from? b end ? ? java jdbc 调用方法: ?? public String getInsureDetail(String obligateFour,String obligateFive) throws UnsupportedEncodingException,Exception { ??? try{ ?????????? conn = new MSConnection().getConnection(); ????????????while ?(rs1!=null&&rs1.next()){ ????????????? ............. ?????????????} ????????? ................. ?????????proc.getMoreResults();??????? ?? ?????while(rs!=null&&rs.next()) { ?????? ??? .................... ??????? } ??? }catch (Exception e) { ??????????? e.printStackTrace(); ??????????? throw new Exception(ChangeCode.utf8ToBase64(e.getMessage())); ??????? } finally { ??????????? try { ??????????????? if (rs1 != null) { ??????????????????? rs1.close(); ??????????????? }??????????? ? ??????????????? if (rs != null) { ??????????????????? rs.close(); ??????????????? } ??????????????? if (proc != null) { ??????????????? ?proc.close(); ??????????????? } ??????????????? if (conn != null) ??????????????????? conn.close(); ??????????? } catch (SQLException e) { ??????????????? e.printStackTrace(); ??????????? } ??????? } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |