Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 92017 invoked from network); 12 Apr 2006 17:41:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2006 17:41:57 -0000 Received: (qmail 96302 invoked by uid 500); 12 Apr 2006 17:41:48 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 95919 invoked by uid 500); 12 Apr 2006 17:41:46 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 95581 invoked by uid 99); 12 Apr 2006 17:41:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 10:41:44 -0700 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=DEAR_SOMETHING X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.100.132.42] (HELO bureau14.utcc.utoronto.ca) (128.100.132.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 10:41:41 -0700 Received: from zarar.sis.utoronto.ca ([128.100.105.83] HELO zarar ident: IDENT-NOT-QUERIED [port 3530]) by bureau14.utcc.utoronto.ca with SMTP id <890310-11084>; Wed, 12 Apr 2006 13:41:10 -0400 Message-ID: <007901c65e58$42db0220$53696480@sis.utoronto.ca> From: "Zarar Siddiqi" To: References: <2E7899FA2A83AB4480078DA88C8F10FBE44EC5@HYD-MDP-MBX01.wipro.com> <443D1487.7030606@ncmail.net> <443D2A50.80802@ncmail.net> Subject: Re: pager in ibatis Date: Wed, 12 Apr 2006 13:40:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The queryForPaginatedList() retrieves all the records from the database and simply then returns a subList based on whatever you've set via gotoPage/nextPage and the page size. So yes, you have to pass in pageSize every time and then set the appropriate page via gotoPage(), nextPage() or previousPage() each time. It's somewhat a manual process. If this is a large query, I'd actually recommend just writing the SQL which efficiently gets the correct set of records that you want. (E.g: LIMIT in MySQL or TOP in SQL Server) Zarar Siddiqi ----- Original Message ----- From: "John Chien" To: Sent: Wednesday, April 12, 2006 12:26 PM Subject: Re: pager in ibatis > L:arry: > > Thank you for the information. > The queryForPaginatedList() will return a list, then I can check for the > existence of successive records by calling the isNextPageAvailable(). > and go to that page by calling gotoPage(); > > However, I can not keep this list in my server due to concurrecy reason. > Does that mean that I have to call the same method every time and give > it the page number for it to return me the records ? > > I am doing the web development. > How can I make use of this returned list in JSP with Struct development ? > > Should I keep the list in the session or request scope ? > > Thanks, > > John Chien > > Larry Meadors wrote: > >>queryForPaginatedList() >> >>Larry >> >> >>On 4/12/06, John Chien wrote: >> >> >>>Dear sir: >>> >>>I have a feature that requires me to return query result of a selection >>>statment in certain amount of successive records every time. >>>This is just like a page. >>> >>>For example: >>> >>>SELECT id, name >>>FROM employee; >>> >>>The selection result of this statement is a list. >>>However, I want to only get 30 records every time. >>>For the first call, I want to get the first 30 (1 - 30) records, for >>>thext call, I would like to get the next 30 (31 - 60) records. >>> >>>How can I do this in Ibatis ? >>> >>>Thanks, >>> >>>John Chien >>> >>> >>> >>> >>> >