六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

詳細的jsp分頁

[摘要]我的一個詳細的jsp分頁程序!(oracle+jsp+apache) 一 前提 希望最新的紀錄在開頭給你的表建立查詢:表:mytable 查詢:create or replace view as m...
我的一個詳細的jsp分頁程序!(oracle+jsp+apache)
一 前提
希望最新的紀錄在開頭給你的表建立查詢:
表:mytable
查詢:create or replace view as mytable_view from mytable order by id desc 其中,最好使用序列號create sequence mytable_sequence 來自動增加你的紀錄id號

二 源程序
<%String sConn="你的連接"
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection(sConn,"你的用戶名","密碼");
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Statement stmtcount=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);

ResultSet rs=stmt.executeQuery("select * from mytable_view");
String sqlcount="select count(*) from mytable_view";
ResultSet rscount=stmtcount.executeQuery(sqlcount);

int pageSize=你的每頁顯示紀錄數;
int rowCount=0; //總的記錄數
while (rscount
int pageCount; //總的頁數
int currPage; //當前頁數
String strPage;
strPage=request.getParameter("page");
if (strPage==null){
currPage=1;
}
else{
currPage=Integer.parseInt(strPage);
if (currPage<1) currPage=1;
}
pageCount=(rowCount+pageSize-1)/pageSize;
if (currPage>pageCount) currPage=pageCount;

int thepage=(currPage-1)*pageSize;
int n=0;
rs.absolute(thepage+1);
while (n<(pageSize)&&!rs
%>
<%rs.close();
rscount.close();
stmt.close();
stmtcount.close();
conn.close();
%>

//下面是 第幾頁等
<form name="sinfo" method="post" action="sbinfo_index.jsp?condition=<%=condition%>&type=<%=type%>" onSubmit="return testform(this)">
第<%=currPage%>頁 共<%=pageCount%>頁 共<%=rowCount%>條
<%if(currPage>1){%><a href="sbinfo_index.jsp?condition=<%=condition%>&type=<%=type%>">首頁</a><%}%>
<%if(currPage>1){%><a href="sbinfo_index.jsp?page=<%=currPage-1%>&condition=<%=condition%>&type=<%=type%>">上一頁</a><%}%>
<%if(currPage<pageCount){%><a href="sbinfo_index.jsp?page=<%=currPage+1%>&condition=<%=condition%>&type=<%=type%>">下一頁</a><%}%>
<%if(pageCount>1){%><a href="sbinfo_index.jsp?page=<%=pageCount%>&condition=<%=condition%>&type=<%=type%>">尾頁</a><%}%>
跳到<input type="text" name="page" size="4" style="font-size:9px">頁
<input type="submit" name="submit" size="4" value="GO" style="font-size:9px">
</form>




主站蜘蛛池模板: 日韩视频亚洲 | 日韩精品特黄毛片免费看 | 天天色影网 | 天天综合色天天综合网 | 欧美无遮挡一区二区三区 | 天天狠天天透天干天天怕处 | 最新国产在线 | 亚洲欧洲精品视频 | 欧美亚洲国产另类 | 亚洲国产欧美在线人成精品一区二区 | 日本天堂免费观看 | 天天摸天天碰天天碰 | 亚洲第一黄色 | 中国女人一级做受免费视频 | 天天操天天射天天插 | 日本三级在线播放线观看2021 | 中文字幕无码中文字幕有码 | 欧洲一级毛片 | 三级在线观看国产 | 青草悠悠视频在线观看 | 天天综合天天影视色香欲俱全 | 亚洲欧美男人天堂 | 日本特黄a级高清免费酷网 日本特黄aaaaaaa大片 | 特黄特黄的视频 | 四虎影院黄色 | 亚洲成人h | 三级黄色片免费观看 | 色噜噜狠狠色综合欧洲 | 日本道高清 | 五月天婷婷在线观看视频 | 亚洲大尺度视频 | 色屁屁影院免费观看入口 | 欧美网址在线观看 | 水蜜桃一区一区三全集 | 欧美亚洲国产成人不卡 | 最新国语露脸精品国产 | 色狠狠色综合久久8狠狠色 色狠狠色综合吹潮 | 涩涩久久 | 天天色综合社区 | 欧美一区二三区 | 欧美专区第一页 |