在ORACLE大数据量下的分页解决方法。一般用截取ID 方法,还有是三层 嵌套方法
编辑: 面试啦 发布时间: 2023-11-10 23:25:06
答:一种分页方法
<%
int i=1;
int numPages=14;
String pages = request.getParameter(“page”) ;
int currentPage = 1;
currentPage = (pages==null)?(1):{Integer.parseInt(pages)}
sql = “select count(*) from tables”;
ResultSet rs = DBLink.executeQuery(sql) ;
第36 页共59 页
while(rs.next()) i = rs.getInt(1) ;
int intPageCount=1;
intPageCount=(i%numPages==0)?(i/numPages):(i/numPages+1);
int nextPage ;
int upPage;
nextPage = currentPage+1;
if (nextPage>=intPageCount) nextPage=intPageCount;
upPage = currentPage-1;
if (upPage<=1) upPage=1;
rs.close();
sql=”select * from tables”;
rs=DBLink.executeQuery(sql);
i=0;
while((i
%>
//输出内容
//输出翻页连接
合计:<%=currentPage%>/<%=intPageCount%>页
第一页
”>上一页
<%
for(int j=1;j<=intPageCount;j++){
if(currentPage!=j){
%>
”>[<%=j%>]
<%
}else{
out.println(j);
}
}
%>
”>下一页
”>最后页
<%
int i=1;
int numPages=14;
String pages = request.getParameter(“page”) ;
int currentPage = 1;
currentPage = (pages==null)?(1):{Integer.parseInt(pages)}
sql = “select count(*) from tables”;
ResultSet rs = DBLink.executeQuery(sql) ;
第36 页共59 页
while(rs.next()) i = rs.getInt(1) ;
int intPageCount=1;
intPageCount=(i%numPages==0)?(i/numPages):(i/numPages+1);
int nextPage ;
int upPage;
nextPage = currentPage+1;
if (nextPage>=intPageCount) nextPage=intPageCount;
upPage = currentPage-1;
if (upPage<=1) upPage=1;
rs.close();
sql=”select * from tables”;
rs=DBLink.executeQuery(sql);
i=0;
while((i
//输出内容
//输出翻页连接
合计:<%=currentPage%>/<%=intPageCount%>页
第一页
”>上一页
<%
for(int j=1;j<=intPageCount;j++){
if(currentPage!=j){
%>
”>[<%=j%>]
<%
}else{
out.println(j);
}
}
%>
”>下一页
”>最后页
词条:oracle面试题
上一篇:简要介绍一下Oracle快照(snapshot) 下一篇:介绍一下嵌套表
面试题库导航
- C++面试题
- JAVA面试题
- Oracle面试题
- MySQL面试题
- Linux面试题
- 网络工程师面试题
- 网管面试题
- 软件工程师面试题
- PHP面试题
- .net面试题
- 软件测试面试题
- EJB面试题
- Spring面试题
- Javascript面试题
- Python面试题
- QTP面试题
- Servlet面试题
- J2EE面试题
- Database面试题
- ASP面试题
- Unix面试题
- Loadrunner面试题
- 通信面试题
- 嵌入式面试题
- Ruby面试题
- Delphi面试题
- Mobile开发面试题
- SOA面试题
- JAVA面试题面试题
- 研发工程师面试题
- 软件架构师面试题
- 系统工程师面试题
- Android面试题
- JAVA程序员
- C#面试题