URGENT!!! I need a solution....

Hi,

I'm working on graduate examination on College of Electrical Science in Belgrade. Theme is selling used cars on the internet(database connection with MySQL database). I have some questions for You:

1. The problem is, how can I define how much results of sql query will be show on html page (something like we see on many search engines like Google or Altavista etc.), in the bottom of page: Result Page: 1 2 3 4 5 Next (1,2,3,4,5 are links to the other pages which satisfy sql query shown above).

I know that is simple for some of you (proffesionals), but I'm a newbie in Java and JSP. I have some solution, but that's not a fine solution.

Thanx.....Milos

[702 byte] By [IsakovicM] at [2007-9-26 1:47:26]
# 1

Greetings,

What you can do is decide how many results you wish to view per page. Once you have decided this then you traverse your recordset that way. You count how many records were returned and display the bottom links as appropriate.

Example:

You want to display 15/page.

Query returned 30 results.

You display options 1 and 2 only.

Hope that helps,

-J

Jaxem at 2007-6-29 2:46:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
See if this helps... http://jsptags.com/tags/navigation/pager
neville_sequeira at 2007-6-29 2:46:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Thanx....thats what I need!!!cheers Milos :)
IsakovicM at 2007-6-29 2:46:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...