PC6下载站

分类分类

如何用Jsp读取Mysql数据库

关注+2004-11-07作者:蓝点

<%//说明count是总的记录的条数

//page是用户提交的参数,用于控制分页的,允许的值是正整数,负整数

int i=count/15; //总页,每页显示15条记录

int j=i/10; //总的大页 ,没10个页面分一大页

//Page 显示的页面

int StartPage;

//int HrefPage;

if (Page<0) Page=0-Page*10; //10页分一次

StartPage=Page/10; //10页分一次

out.print ("[共有"+i+"页]");

//out.print ("共有"+j+"屏");

//out.print ("显示第"+Page+"页");

//out.print ("StartPage="+StartPage);

if (StartPage>0)

out.print ("|前10页");

for (int k=0;k<10;k++)

{ int p=StartPage*10+k;

if (p>i) break;

if (p==Page)

out.print ("|第"+Integer.toString(p+1)+"页");

else

out.print ("|第"+Integer.toString(p+1)+"页");

}

if (StartPage
out.print ("|后10页");

out.print ("|");

%>
展开全部

相关文章

更多+相同厂商

热门推荐

  • 最新排行
  • 最热排行
  • 评分最高
排行榜

    点击查看更多

      点击查看更多

        点击查看更多

        说两句网友评论

          我要评论...
          取消