Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 92954 invoked from network); 12 Apr 2006 17:44:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Apr 2006 17:44:08 -0000 Received: (qmail 98037 invoked by uid 500); 12 Apr 2006 17:43:56 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 98020 invoked by uid 500); 12 Apr 2006 17:43:56 -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 98009 invoked by uid 99); 12 Apr 2006 17:43:56 -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:43:56 -0700 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=DEAR_SOMETHING,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of larry.meadors@gmail.com designates 66.249.82.198 as permitted sender) Received: from [66.249.82.198] (HELO xproxy.gmail.com) (66.249.82.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 10:43:55 -0700 Received: by xproxy.gmail.com with SMTP id i31so1035487wxd for ; Wed, 12 Apr 2006 10:43:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Tx0/3DQFpOPBdr4ZZmnfaNfKkkLtk6cq0mf5AxQG/iWqE88yjpknHsqBNt5ksPT8U6GWJHLHSPzuJdvpHDbLjt7NCfha8uXciIw8u+Ox4yT0vzzyR0AfwCaD20x1IQFYPUo4wJt3ORstNLdwDo79j/i5k6Q3+S2l5AM0XFwnF/0= Received: by 10.70.122.20 with SMTP id u20mr2755839wxc; Wed, 12 Apr 2006 10:43:34 -0700 (PDT) Received: by 10.70.76.11 with HTTP; Wed, 12 Apr 2006 10:43:34 -0700 (PDT) Message-ID: Date: Wed, 12 Apr 2006 11:43:34 -0600 From: "Larry Meadors" Reply-To: lmeadors@apache.org Sender: larry.meadors@gmail.com To: user-java@ibatis.apache.org Subject: Re: pager in ibatis In-Reply-To: <007901c65e58$42db0220$53696480@sis.utoronto.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2E7899FA2A83AB4480078DA88C8F10FBE44EC5@HYD-MDP-MBX01.wipro.com> <443D1487.7030606@ncmail.net> <443D2A50.80802@ncmail.net> <007901c65e58$42db0220$53696480@sis.utoronto.ca> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Agreed. Larry On 4/12/06, Zarar Siddiqi wrote: > The queryForPaginatedList() retrieves all the records from the database a= nd > 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 pageSiz= e > every time and then set the appropriate page via gotoPage(), nextPage() o= r > previousPage() each time. It's somewhat a manual process. > > If this is a large query, I'd actually recommend just writing the SQL whi= ch > efficiently gets the correct set of records that you want. (E.g: LIMIT i= n > 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 th= e > > 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 selectio= n > >>>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 > >>> > >>> > >>> > >>> > >>> > > > > >