Help....Help....Help I'm the newone in JSP

I have some questions:

1. The problem is, how can I define how much results of sql(mySQL) 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 have some suggestion to do this, but I don't really understand this:

(A) Limit how many times you call resultSet.next(). Save the ResultSet in the session object.

(B) Look up all the data from the database, store it in a DBResults object, but only print 10 results at a time. Store the DBResults object in the session object.

Thanx.....missa

[718 byte] By [IsakovicM] at [2007-9-26 1:24:44]
# 1

hi

there r a couple of ways to do that

1.you could use custom java function that returns the resultset as an object and the object can be converted to object list which make it easy for u to do the page navigations,this is quite complex but very efficient

2.simply use ur resultset calculate the max records u r going to display against the total no of records.u could use reultset.absolute(-1)....

3.i don't think storing the entire resultset in a sessionobject is a good idea however it entirely depends on the scope of ur project.

cheers

suri

suri_dev at 2007-6-29 1:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanx for your help, but would You be so good to me and send me some code.
IsakovicM at 2007-6-29 1:05:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...