点击换页按钮后可以获取layui自动返回的数值
找到这个页面
String pageStr=request.getParameter("page");
String limitStr=request.getParameter("limit");
接受数据
展示的方法加入page和limit这两个参数
查询编程这个样子
再定义 public int countArr() throws SQLException, ClassNotFoundException {
String sql1="select count(*) as sum from contract";
Connection connection = util.util.getConnection();
PreparedStatement ps = connection.prepareStatement(sql1);
ResultSet rs = ps.executeQuery();
while(rs.next()) {
return rs.getInt("sum");
}
return 0;
}
用来返回数据表格的全部数据数量
result.put("count",dao.countArr());//用来接受
标签:return,分页,rs,layui,sum,getParameter,String From: https://www.cnblogs.com/jyt604743080/p/16830224.html