more rows than I cna handle

I have written a small JSP application.

It accesses an oracle DB and returns may rows.

If the no of rows is too large the the buttons used to navigate the app dissapear off the bottom of the screen.

(I know I should have considered but I ma new to developing)

Does anyone have code that uses jdbc/sql to count the rrows and links the count to a next and previous button.

the next and previous button would rerender the existing form but with the next 10 rows or the previous rows.

Many Thanks.

Peter

[555 byte] By [peterbarry2002] at [2007-9-26 1:42:37]
# 1

u can have 2 fns in the java script like this..

function getNextRows(begin,end){}

function getPrevRows(begin,end)

{}

in the body section u can set a value for nav and activate the javascript fns using the choice like this..

String nav = (request.getParameter("nav")==null)?"next":request.getParameter("nav");

if (nav.equals("next"))

{//display}

if (nav.equals("prev"))

{//display}

the value for begin and end ex: begin =0;end=10

int begin = Integer.parseInt((request.getParameter("begin")==null)?"0":request.getParameter("begin"));

int end = Integer.parseInt((request.getParameter("end")==null)?"10":request.getParameter("end"));

display 10 recs at a time

if (begin > 10)

{

<a href='javascript:getPrevRows("+start+","+endstart+")'>Previous </a>);

}

if(begin < max)

<a href='javascript:getNextRows("+begin+","+end+")'>Next </a>);

hope this helps

greatchivi at 2007-6-29 2:35:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...