beetlsql 调用带有输出参数的存储过程

 List<Integer> listResult = cdao.getSQLManager().executeOnConnection(new OnConnection<List<Integer>>() {
            @Override
            public List<Integer> call(Connection conn) throws SQLException {
                CallableStatement cstmt = conn.prepareCall("{call ntContractDelete(?,?)}");
                cstmt.setInt(1, pmcIdParam);//第一个参数
                cstmt.registerOutParameter(2, Types.INTEGER); //第二个输出参数,注册下
                cstmt.execute();

                int iResult = cstmt.getInt(2); 
                List<Integer> listResult2 = new ArrayList<>(10);
                listResult2.add(iResult);
                return listResult2;
            }
        });

返回必须是一个list,带有泛型。 嗯。。。 连接啥的应该不用管吧,嗯,不知道,不研究了,先不管-_-||

猜你喜欢

转载自blog.csdn.net/weixin_38728273/article/details/88667058