This solution is through Java
you can make use of the
Methods provided by the ResultSet
I am Sending you the code for pagination
ResultSet rs=null;
boolean isPageSelected = false;
int lb = 0 , ub = 0 ,pg = 0,totalrecords=0,recordsPerPage=10;
// variables used in paging
String selected_page= request.getParameter("page");
if(selected_page == null || selected_page == "" || selected_page.equals("") )
{// page not selected
isPageSelected = false;
selected_page="";
lb = 0;
ub =recordsPerPage;
}
else
{// page is selected
isPageSelected = true;
pg = Integer.valueOf(selected_page).intValue();
lb = recordsPerPage*(pg-1);
ub = lb + recordsPerPage;
}
query="select * from temp";
rs=st.executeQuery(query);
rs.last(); // Jump to last row
totalrecords = rs.getRow(); // get the row count
rs.beforeFirst();
// reset to allow forward cursor processing
int noofpages=0;
if(totalrecords%recordsPerPage==0)
noofpages = totalrecords/recordsPerPage;
else
noofpages = totalrecords/recordsPerPage +1;
int cnt = lb;
rs.absolute(lb+1); // move to record
do{
// get the details what ever you want
cnt++;
}while(rs.next()& (cnt<=ub))