Data Mgmt Lab_Part_24 - 70 Chapter 7 Placeholder Technique:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
70 Chapter 7 Placeholder Technique: The simplest approach to top N queries is to store a placeholder for the Frst and last result tuples, and then perform the same query. When the new query results are returned, you can iterate to the placeholders and return the previous or next 20 results. Tuples Shown Lower Placeholder Previous Set Upper Placeholder Next Set 1-20 1 None 20 21-40 21-40 21 1-20 40 41-60 41-60 41 21-40 60 61-80 Write a webpage in JSP that displays the contents of the Books table, sorted by the Title and BookId, and showing the results 20 at a time. There should be a link (where appropriate) to get the previous 20 results or the next 20 results. To do this, you can encode the placeholders in the Previous or Next Links as follows. Assume that you are displaying records 21–40. Then the previous link is display.jsp?lower=21 and the next link is display.jsp?upper=40 . You should not display a previous link when there are no previous results; nor should you show a Next link if there are no more results. When your page is called again to
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Data Mgmt Lab_Part_24 - 70 Chapter 7 Placeholder Technique:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online