10.5  项目设计

时间:2007-09-26 来源:IT在中国 编辑: 作者:IT在中国 [ ]
  在设计项目时,我们可以将项目分成模块化来设计并实施,这样可以便于我们管理

  //设置一页显示的记录数

 intPageSize =15;

//取得待显示页码

strPage = request.getParameter("page");

lei = request.getParameter("lei"); //图书类别

if(lei==null){

lei="1";

}

if(strPage==null){

//表明在QueryString中没有page这一个参数,此时显示第一页数据

  intPage = 1;

  }

else{

//将字符串转换成整型

intPage = java.lang.Integer.parseInt(strPage);

}

sql="select * from tushumingxi where lieID="+java.lang.Integer.parseInt(lei);

Statement selstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

rs=selstmt.executeQuery(sql);

if(intPage< 1){

intPage = 1;

}

//获取记录总数

rs.last();

intRowCount = rs.getRow();

//记算总页数

intPageCount = (intRowCount+intPageSize-1) / intPageSize;

//调整待显示的页码

if(intPage >intPageCount) intPage = intPageCount;

if(intPageCount >0){

//将记录指针定位到待显示页的第一条记录上

rs.absolute((intPage-1) * intPageSize+1);

//显示数据

}

i = 0;

while(i< intPageSize && !rs.isAfterLast()){

int bkid=rs.getInt("shuID");

上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] 下一页


访问() 相关评论() 打印资源 返回顶部 加入收藏

最新评论