Collections.shuffle(List,Random) is what you're searching. Eighter shuffle your list of results, or shuffle a list of keys to access a map of results in a random order. Put this list in the users session to access it whenever your servlet's asked to serve the next "result page". For the "several pages" thing search the archives for "page-by-page iterator" if you don't know how you want to do that, yet.
HTH! -mw ----- Original Message ----- From: "Carter, Scott" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2003 5:27 PM Subject: handling result sets in random order across pages > My problem is really very simple but I am not sure what the best way to > solve it is. I perform a query against my database, which always returns my > results in the same order, and I want to randomize the ordering. The only > other part of this problem that makes it tricky is I am not displaying all > of the results on a single page, so how ever I decide to manage the > randomizing of the result set order, I have to keep up with it over several > pages. Any ideas? Has anyone done this? > > Thanks - Scott Carter > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
