⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dividepage.java

📁 java版的发送电子邮件组件
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DividePage.java

package dispose;

import com.zyf.tools.connectdb.DBOS;
import java.sql.ResultSet;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpSession;

public class DividePage
{

    public int rTotal;
    public int perTotal;
    public int pageTotal;
    public int recordP;
    public int reqPageNum;
    public String reqPageNo;
    public String pageURL;
    public String pageInfo[] = {
        "", "", "", "", "", ""
    };
    public String selP;
    public String sel;
    public DBOS oper;
    public HttpSession session;
    public ServletRequest request;

    public DividePage()
    {
        rTotal = 0;
        perTotal = 10;
        pageTotal = 0;
        recordP = 0;
        reqPageNum = 0;
        reqPageNo = "0";
        pageURL = "";
        oper = new DBOS();
    }

    public void setPagePara(HttpSession httpsession, ServletRequest servletrequest, String s, int i, String s1)
    {
        session = httpsession;
        request = servletrequest;
        sel = s;
        perTotal = 15;
        pageURL = s1;
    }

    public Object[][] getResult()
        throws Exception
    {
        reqPageNo = request.getParameter("pageNo");
        if(session.getAttribute("selP") != null)
            selP = session.getAttribute("selP").toString();
        if(reqPageNo != null)
            sel = selP;
        oper.sexe(sel);
        session.setAttribute("selP", sel);
        session.setAttribute("perTotal", Integer.toString(perTotal));
        if(!oper.result.last())
        {
            return null;
        } else
        {
            rTotal = oper.result.getRow();
            getRecordP();
            Object aobj[][] = oper.selResult(recordP + 1, perTotal);
            oper.releaseResource();
            return aobj;
        }
    }

    public void getRecordP()
    {
        if(rTotal % perTotal > 0)
            pageTotal = rTotal / perTotal + 1;
        else
            pageTotal = rTotal / perTotal;
        if(reqPageNo == null)
            reqPageNo = "1";
        reqPageNum = Integer.parseInt(reqPageNo);
        if(reqPageNum < 1)
            reqPageNum = 1;
        if(reqPageNum > pageTotal)
            reqPageNum = pageTotal;
        recordP = (reqPageNum - 1) * perTotal;
    }

    public String[] getPageInfo()
    {
        if(rTotal % perTotal > 0)
            pageTotal = rTotal / perTotal + 1;
        else
            pageTotal = rTotal / perTotal;
        if(reqPageNo == null)
            reqPageNo = "1";
        reqPageNum = Integer.parseInt(reqPageNo);
        if(reqPageNum < 1)
            reqPageNum = 1;
        if(reqPageNum > pageTotal)
            reqPageNum = pageTotal;
        if(reqPageNum > 1)
        {
            pageInfo[0] = "<a href=\"" + pageURL + "?pageNo=1\">第一页</a>";
            int i = Integer.parseInt(reqPageNo, 10);
            if(i > 1)
                i--;
            String s = Integer.toString(i);
            pageInfo[1] = "<a href=\"" + pageURL + "?pageNo=" + s + "\">上一页</a>";
        }
        if(reqPageNum < pageTotal)
        {
            int j = Integer.parseInt(reqPageNo, 10);
            if(j < pageTotal)
                j++;
            String s1 = Integer.toString(j);
            pageInfo[2] = "<a href=\"" + pageURL + "?pageNo=" + s1 + "\">下一页</a>";
            pageInfo[3] = "<a href=\"" + pageURL + "?pageNo=" + pageTotal + "\">最后页</a>";
        }
        if(reqPageNum > pageTotal)
            reqPageNum = pageTotal;
        pageInfo[4] = "结果共" + pageTotal + "页";
        pageInfo[5] = "显示第" + reqPageNum + "页";
        return pageInfo;
    }

    public void clear()
    {
        session = null;
        request = null;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -