Hello Mindaugas,

Saturday, June 16, 2001, 10:36:45 PM, you wrote:

MI> My original goal is to ask the database for a page of information at a time.
MI> However, MS SQL server does not let you display your results starting at an
MI> offset.

MI> In my web app's search method, I load the ResultSet into a LinkedList and
MI> use the struts iterate taglib to display the results to the JSP tags pager
MI> taglib.

MI> So, I see two ways of resolving this. 1) Do the query one time and store the
MI> LinkedList in the session -- effectively caching the entire results in
MI> memory. 2) Query the database each time and skip over the first n results
MI> and discarding the last x results.

MI> Neither of these solutions are really ideal since the the ammount of results
MI> I expect to return are in 1,000 range.

MI> So, is it time to pick a better database? Thanks.

I think you have next variants -

1. Cach results in session (if you have large amount of memory - it is
   your way) or in application scope (if you use static data set).
2. Write stored proc in SQL Server -
   by the stored proc you can query database, scroll to the target row
   and return limited count of rows
3. Query database directly -
   you can scroll directly - via ResultSet.absolute(int) - if your
   JDBC driver supports scrollable result sets, or scroll manually -
   via ResultSet.next().

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to