清穿女配要改嫁下载:JSP分页问题~!帮我改成函数!~
来源:百度文库 编辑:神马品牌网 时间:2024/05/06 10:54:31
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public int fenye(String cint)
{
public int PageSize=2; //一页显示的记录数
public int RowCount; //记录总数
public int PageCount; //总页数
public int Page; //待显示页码
public String strPage;
public int i;
public int start;
public fenye(){}
public static void Get(HttpServletRequest request) throws Exception
{
strPage = request.getParameter("page"); //取得待显示页码
if(strPage==null)
Page = 1;
else
Page = java.lang.Integer.parseInt(strPage);
if(Page< 1)
Page = 1;
Rs.last();
RowCount = Rs.getRow();
PageCount = (RowCount+PageSize-1) / PageSize;
if(Page >PageCount)
Page = PageCount;
if(PageCount >0)
Rs.absolute((Page-1) * PageSize+1);
start = (Page - 1) * PageSize;
}
public setPageSize(int Size)
{
this.PageSize=Size;
}
}
帮我把他改好来,成函数,或者类QQ185259693
改好后在给50分
public fenye(){}
public static void Get(HttpServletRequest request) throws Exception
{
strPage = request.getParameter("page"); //取得待显示页码
if(strPage==null)
Page = 1;
else
Page = java.lang.Integer.parseInt(strPage);
if(Page< 1)
Page = 1;
Rs.last();
RowCount = Rs.getRow();
PageCount = (RowCount+PageSize-1) / PageSize;
if(Page >PageCount)
Page = PageCount;
if(PageCount >0)
Rs.absolute((Page-1) * PageSize+1);
start = (Page - 1) * PageSize;
}
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public int fenye(String cint)
{
public int PageSize=2; //一页显示的记录数
public int RowCount; //记录总数
public int PageCount; //总页数
public int Page; //待显示页码
public String strPage;
public int i;
public int start;
public fenye(){}
public static void Get(HttpServletRequest request) throws Exception
{
strPage = request.getParameter("page"); //取得待显示页码
if(strPage==null)
Page = 1;
else
Page = java.lang.Integer.parseInt(strPage);
if(Page< 1)
Page = 1;
Rs.last();
RowCount = Rs.getRow();
PageCount = (RowCount+PageSize-1) / PageSize;
if(Page >PageCount)
Page = PageCount;
if(PageCount >0)
Rs.absolute((Page-1) * PageSize+1);
start = (Page - 1) * PageSize;
}
public setPageSize(int Size)
{
this.PageSize=Size;
}
}
帮我把他改好来,成函数,或者类QQ185259693
改好后在给50分
public fenye(){}
public static void Get(HttpServletRequest request) throws Exception
{
strPage = request.getParameter("page"); //取得待显示页码
if(strPage==null)
Page = 1;
else
Page = java.lang.Integer.parseInt(strPage);
if(Page< 1)
Page = 1;
Rs.last();
RowCount = Rs.getRow();
PageCount = (RowCount+PageSize-1) / PageSize;
if(Page >PageCount)
Page = PageCount;
if(PageCount >0)
Rs.absolute((Page-1) * PageSize+1);
start = (Page - 1) * PageSize;
}
我发现MSSQL中JSP很难分页的