日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

mysql的分页怎么不对_jsp+mysql分页显示我的怎么不对啊?显示始终不对!

發布時間:2024/7/23 94 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql的分页怎么不对_jsp+mysql分页显示我的怎么不对啊?显示始终不对! 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

My JSP 'wel.jsp' starting page

登陸成功!恭喜恭喜!

返回重新登錄


用戶信息列表

//定義分也會用到的四個分頁

int pageSize=3;

int pageNow=1; //默認顯示第一頁

int rowCount=0;

int pageCount=0;//通過pageSize和rowCount得到的

//查詢得到rowCount

//1.加載驅動

Class.forName("com.mysql.jdbc.Driver");

//2.得到連接

Connection ct=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/test","root","198673");

//3.創建Statment

Statement sm=ct.createStatement();

//4.查詢

ResultSet rs=sm.executeQuery("select count(*) from users ");

//必須要rs.next(),否則痛不欲生

if(rs.next())

{

rowCount=rs.getInt(1);

}

//計算pageCount

if(rowCount%pageSize==0)

{

pageCount=rowCount/pageSize;

}else{

pageCount=rowCount/pageSize+1;

}

//查詢需要顯示的記錄,注意是在mysql中

rs=sm.executeQuery("select passwd from users limit"+(pageNow-1)*pageSize+","+pageSize);

//顯示

%>

while(rs.next()){

%>

}

%>

%>

展開

總結

以上是生活随笔為你收集整理的mysql的分页怎么不对_jsp+mysql分页显示我的怎么不对啊?显示始终不对!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。