Using Vector is the simplest way but you might want to encapsulate it in a more useful construct. There isn't much more you can do. Either you go to the database on each request or you cache the results right?
You can try to optimize both but ultimately it is the database, the type of data it holds, and usage patterns that will decide which approach to use. Database: - Local or far away. - Performance overall (if it performs poorly it hurts the project). Type of data - Heavily updated dynamic data - Static data - Mix of both. Application usage patterns - Does every use make a completely different query? - Can some queries be anticipated and so the results cached for later usage? - Can data be stale for some time (~10 seconds) and then refreshed or expired based on usage? For example, for searches that are generic and similar for all users you might want to cache the result in a construct that can be shared among all users. Stock symbols that traded up yesterday will be a static result set for all users requesting it. There is no point in going to database for it nor is there any in having a separate result set construct for each client making that query. BOY is this off topic... :) d. Gianluca Gravina wrote: > Excuse me, can U make a little example, I looked at Statement API, but I > didn't found anything interesting. I'd like to understand how U can do > it. I hope U haven't to fetch all of the resultset save the rows in > Vectors and show for example Vector elements from 0 to 0+i, then from > 0+i to 0+2i and so on ... > > Thanks, Gianluca > > >>-----Messaggio originale----- >>Da: A mailing list for discussion about Sun Microsystem's >>Java Servlet API Technology. >>[mailto:[EMAIL PROTECTED]] Per conto di David Mossakowski >>Inviato: gioved� 9 maggio 2002 20.45 >>A: [EMAIL PROTECTED] >>Oggetto: Re: How can I show some results at a time? >> >> >>This problem has been discussed a number of times. In short, >>after performing a search, store your results in a construct >>that takes a starting index and returns another construct >>loaded with the subset of the results. >> >>d. >> > > > ___________________________________________________________________________ > 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 > > > -- David Mossakowski [EMAIL PROTECTED] Instinet Corporation 212.310.7275 ******************************************************************************* <<Disclaimer>> This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL or both. This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return mail and permanently deleting the copy you received. Thank you. ******************************************************************************* ___________________________________________________________________________ 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
