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 off heap memory?

0 Answers  


Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.

9 Answers  


How can I debug the Java security exceptions and AccessControlExceptions?

0 Answers   IBM,


What is garbage collection? What is the process that is responsible for doing that in java?

0 Answers  


What is jagged array in java?

0 Answers  






Can we have static methods in an interface?

0 Answers  


What is the difference between heap memory and stack memory?

0 Answers   Aspiring Minds,


What is treemap in java?

0 Answers  


What is binary search in java?

0 Answers  


which swing component is similar to rich text box in .net/vb

1 Answers  


what is the difference between sleep() and Wait()?

10 Answers   Accenture, Amdocs,


what is interface in java? Explain

0 Answers  


Categories