Java调用存储过程

Connection conn = null;
        ResultSet rs = null;
        CallableStatement statm = null;
        List<ClubStatisticeVo> listVo = new ArrayList<ClubStatisticeVo>();
        //调用存储过程,返回sql
            conn = JdbcUtil.getConnection();
            statm = conn.prepareCall("{call pro_rpt_all_statistics_s(?,?,?)}");
            statm.registerOutParameter(3, java.sql.Types.VARCHAR);
            statm.setString(1, month);
            statm.setString(2, dept);
            statm.executeUpdate();
            String result = statm.getString(3);
            PreparedStatement ps = conn.prepareStatement(result);
            rs = ps.executeQuery();


你可能感兴趣的:(java,存储过程)