You can I think start a counter as you loop through your record set .
With an IF statment you stop when the counter reaches ten .
All you then need to do is create a dyanmic sql statement. Probaly by
passing the value of 10 back to the browser in a A link
<a href="search?id=10">Next 10 records</a>
You then pick up the value of ID and push into a dynamic SQL statement.
String SQL = "select * from sometable where ID > " + id
hence you should get something like this ...
select * from sometable where ID > 10
By using SQL and the "<" or ">" functions you should be able to specify that
you start search after the 10 th record..
excuse my syntax but I hope this helps and gives you a better idea..
; )
James
Web Developer
www.laserrec.co.uk
IT Recruitment in the UK
----- Original Message -----
From: "Marcos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 13, 2000 5:16 PM
Subject: designing servlet (back and forward)
> hi,
>
> i am running a servlet to show some info from a database. the
> problem is that the database query answers 40 items back and i want to
> put just 10. and with back a forward you should move all over the
> results. how can i manage that thing?
>
> after the query is done. is there any property to find out how many
> items are selected? should do i add more fields in my database?
>
> any suggestions will be pleased,
>
> thanks in advance,
>
> marcos
>
>
> --
> m a r c o s @ i v a l . e s
>
>
___________________________________________________________________________
> 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