🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #20007

Re: [jsp]��session�б��������Ƿ���ʣ�

#20007
From: 99SE.Eric.Hsu.��̹ܿ�
Date: Thu, 25 Dec 2003 11:46
52 lines
2861 bytes
You can store any amount of data in the session object
for more information, pls look at here:
    http://www.jguru.com/faq/view.jsp?EID=32704

However, for database result set paging, we have a better
solution:

    . If you're using Oracle like me, you can use the 
    following method from my application:

  protected String getPagingSQLStatement(String _sqlStatement,
                                         int _iEntriesPerPage,
                                         int _iCurrentPage) {

    int iStart = (_iCurrentPage - 1) * _iEntriesPerPage + 1;
    int iEnd = iStart + _iEntriesPerPage;
 
    String pagingSQLStatement;
    pagingSQLStatement =
        "SELECT outter.* FROM (SELECT rownum rownumber, inner.* FROM (" +
        _sqlStatement +
        ") inner WHERE rownum < " +
        iEnd +
        ") outter WHERE rownumber >= " +
        iStart;

   return pagingSQLStatement;
                                                                             
  }

    . If you are using MySQL, use the following SQL query instead:

        "SELECT [columns you would like to select] FROM
         [your table] WHERE [your conditions] LIMIT 100, 20"

    "LIMIT 14, 20" means select records from 14 to 34

Hope it helps :)


 �� �� lazyworm.bbs@Freecity.dhs.org (���߲�����) �Ĵ�������
��: ��: ����webӦ��ʱ����session�б���������һ����1000����ݼ�¼��List��
: Ȼ���ڲ�ͬ��ҳ���н�����ʾ������������������ʲô���⣿�᲻�ᵼ������
: һ��ʱ�����������ܽ�������������


--
                It's easy to get pieces done
                It's not so easy to get done with pieces

                                        - 03.12.16.Eric
�� ��Դ:���Ұ��Ͽ�վ bbs.nankai.edu.cn��[FROM: 202.113.30.24] 
Technical Details
Message-ID: <4A0MMB$ACL@bbs.nankai.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!diablo.voicenet.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f6cb0,1a2dfa3d4ce3f17e,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2003-12-25 03:47:23 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!diablo.voicenet.com!38.144.126.100.MISMATCH!feed5.newsreader.com!newsreader.com!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai
From: OtherVoices.bbs@bbs.nankai.edu.cn (99SE.Eric.Hsu.��̹ܿ�)
Newsgroups: cn.bbs.comp.lang.java
Subject: Re: [jsp]��session�б��������Ƿ���ʣ�
Date: 25 Dec 2003 11:46:39 GMT
Organization: �Ұ��Ͽ�վ
Message-ID: <4A0MMB$ACL@bbs.nankai.edu.cn>
X-Filename: Java/M.1072351787.A
Lines: 52