I have 100 records in a table with two rows. I need to
display 10 records per page like Google Search. I need only
the Logic(Pagination) in Pure Java. No JSP and all..Thanks
in Advance...

Answers were Sorted based on User's Feedback



I have 100 records in a table with two rows. I need to display 10 records per page like Google Sea..

Answer / avani

String strPageNum = request.getParameter(“pageNum”);
int pageNum = 0;
if(strPageNum != null){
pageNum = new Integer(strPageNum).intValue();
}
int maxRowsPerPage = new Integer(request.getParameter
(“rowsPerPage”)).intValue();
//calculate
int rowEnd = pageNum * maxRowsPerPage;
int rowStart = (rowEnd - maxRowsPerPage) + 1;

Is This Answer Correct ?    9 Yes 8 No

I have 100 records in a table with two rows. I need to display 10 records per page like Google Sea..

Answer / sivadasan

Thanks Avani...

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Core Java Interview Questions

What is compile time polymorphism?

20 Answers   CTS, Elementus Technologies, Oracle,


What are the two ways you can synchronize a block of code?

5 Answers   Ericsson,


What is the purpose of the system class in java?

0 Answers  


What do you mean by thread safe?

0 Answers  


What is inner class?what is the use of inner class?where we create the object for inner class? and inner class can extend any class or inner class can implement any interface?

1 Answers   Wipro,






What are extraneous variables examples?

0 Answers  


What a static class can contains?

0 Answers  


Can a class extend more than one class?

0 Answers  


What is difference between call by value and call by reference?

0 Answers  


Can we use this () and super () in a method?

0 Answers  


What is math floor in java?

0 Answers  


What is the return type of read()?

3 Answers  


Categories