<code>
cstmt = con.prepareCall(“{?=call sp_cursoropen(?, ?, ?, ?, ?)}”,
1004, 1008);
cstmt.registerOutParameter(1, Types.INTEGER);
cstmt.registerOutParameter(2, Types.INTEGER);
log.info(sql);
cstmt.setString(3, sql);
cstmt.setInt(4, 1);
cstmt.registerOutParameter(4, Types.INTEGER);
cstmt.setInt(5, 1);
cstmt.registerOutParameter(5, Types.INTEGER);
cstmt.registerOutParameter(6, Types.INTEGER);
rs = cstmt.executeQuery();
log.info(rs.getMetaData().getColumnCount());
log.info(rs.next());
log.info(cstmt.getInt(1));
int cursor = cstmt.getInt(2);
log.info(cursor);
log.info(cstmt.getInt(4));
log.info(cstmt.getInt(5));
log.info(cstmt.getInt(6));
countSize = cstmt.getInt(6);
countPage = (int) Math.ceil(1.0 * countSize / pageSize);
cstmt.close();
rs.close();
cstmt = con.prepareCall(“{?=call sp_cursorfetch(?, ?, ?, ?)}”);
cstmt.registerOutParameter(1, Types.INTEGER);
cstmt.setInt(2, cursor);
cstmt.setInt(3, 16);
cstmt.setInt(4, (page-1)*pageSize+1);
log.info(“page:”+page);
cstmt.setInt(5, pageSize);
log.info(“pageSize:”+pageSize);
rs = cstmt.executeQuery();
</code>
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/100631.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...