信息显示
chaxun
信息显示
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount; //总页数
int intPage; //待显示页码
string keyword=request.getParameter("word");//取得关键字
String sql="select * from student where webname like '%"+keyword+"%'";
intPageSize = 2; //设置一页显示的记录数
intRowCount=DB.getResultCount(sql);//记录总数
intPageCount=(intRowCount+intPageSize-1)/intPageSize;//总页数
ResultSet rs=DB.executeQuery(sql);
String strPage = request.getParameter("page");//取得待显示页码
if(strPage==null){//表明没有page参数,显示第一页数据
intPage = 1;
}else{
intPage = Integer.parseInt(strPage);//将字符串转换成整型
if(intPage<1){
intPage = 1;
}else if(intPage>intPageCount){
intPage=intPageCount;
}
}
%>
请输入您想查询用户的姓名中所包含的字:
用户名 | 姓名 | 年龄 | 性别 | 手机号 |
---|
if(intPageCount>0){
rs.absolute((intPage-1) * intPageSize + 1);
//显示数据
int i = 0;
while(i
%>
rs.next();
i++;
}
}
%>
第页 共页
1){
%>
}
if(intPage
%>
}
%>
转到第: 页
展开