Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by KevinWilliams:
http://wiki.apache.org/ws/WorkingWithPaging

------------------------------------------------------------------------------
  }
  }}}
  
+ A Pager is instantiated on a given read Command and the constructor is used 
to specify the desired page size (number of dataase rows per page).  The 
following example illustrates constrution and use of a pager:
+ {{{
+         DAS das = DAS.FACTORY.createDAS(getConnection());
+         // Build command to read all customers
+         Command custCommand = das.createCommand("select * from CUSTOMER order 
by ID");
+ 
+         // Create a pager with the command
+         Pager pager = new PagerImpl(custCommand, 2);
+ 
+         // Get and work with first page
+         DataObject root = pager.next();
+         DataObject customer1 = root.getDataObject("CUSTOMER[1]");
+         DataObject customer2 = root.getDataObject("CUSTOMER[2]");
+ 
+         // Get and work with the second page
+         root = pager.next();
+         customer1 = root.getDataObject("CUSTOMER[1]");
+         customer2 = root.getDataObject("CUSTOMER[2]");
+ 
+         // First page again
+         root = pager.previous();
+         customer1 = root.getDataObject("CUSTOMER[1]");
+         customer2 = root.getDataObject("CUSTOMER[2]");
+ 
+ }}}
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to