Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how do i display every 10 Records in my JSP page??

807598Oct 13 2006 — edited Feb 28 2008
Hi..
I have developed one web-page which shows ALL employee records fetched from a employee table and display them in my JSP page.
It has contain more than 1000's of records. I need to display first 10 Records in my page. There should be some 4 links below the records display which get me to see next 10 records or previous 10 records or first 10 records or Last 10 records.
IS it possible in JSP??

This is my sample code for your ref:

<jsp:useBean id="empOperation" class="com.venki.gen.EmployeeOperation" />
<html>
<head>
	<title>Stardeveloper : DataAccess JSP Tag</title>
	<style>
	p, td { font-family:Tahoma,Sans-Serif; font-size:8pt;
		padding-left:15; }
	</style>
</head>
<body>

<p align="center"><u>DataAccess JSP Tag</u></p>
<% 
	EmployeeList empList[] = null;
	empList = empOperation.getEmployees(empName);
%>
<table align="center" border="0" width="90%" cellspacing="2" cellpadding="2">
<tr bgcolor="#CCDDEE">
	<td>EMPNO</td>
	<td>EMP Name</td>
	<td>DESIGNATION</td>
</tr>
<%if(empList!=null)
	for(int i=0; i<empList.length; i++)
	{
	 EmployeeList emp = empList;%>
<tr bgcolor="#F7F7F7">
<td><%= emp.getEmpNo() %></td>
<td><%= emp.getEmpName() %></td>
<td><%= emp.getEmpDesignation()%></td>
</tr>
<% }%>
</table>

</body>
</html>



It would be extremely useful,if i know the technique how to display every 10 Records thru JSP.
Waiting for You people valuable reply and code!

Regards
venki
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2008
Added on Oct 13 2006
9 comments
3,579 views