Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to display the details of employee. in prescribed format

 
sureshkumarneeli kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to display the details of employee. in prescribed format, can any body help me how to generate pay slip using jsp.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello sureshkumarneeli kumar,

I could you post the JSP code again?
 
sureshkumarneeli kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>

<HTML>
<HEAD>
<center>
<TITLE>The Details of Employee is:</TITLE>
</HEAD>
<body background="bg.gif">

<img src="logo.png" width="100%" height="30%">
<img src="Epfo_logo.gif" width="15%" height="20%">
<BODY>
<H1>The Employee details are..</H1>

<%
Connection connection = DriverManager.getConnection(
"jdbc:odbc:adm", "system", "suresh");

Statement statement = connection.createStatement();

String empno = request.getParameter("empno");

ResultSet resultset =
statement.executeQuery("select name,emp_no,year,desig,basic,dearpay,basicpay,da,ndcps,da_arrears,pay_arrears,total from nmk where EMP_NO = '" + empno + "'") ;

%><%
while(resultset.next())
{%>
</center>
<center>
<TABLE BORDER="1">
<TR>
<TH>Name</TH>
<TH>EMP_NO</TH>
<TH>year</TH>
<TH>desig</TH>
<TH>basic</TH>
<TH>dearpay</TH>
<TH>basicpay</TH>
<TH>da</TH>
<TH>ndcps</TH>
<TH>da_arrears</TH>
<TH>pay_arrears</TH>
<TH>total</TH>
</TR>

<TR>

<TD> <%= resultset.getString(1) %> </TD>
<TD> <%= resultset.getString(2) %> </TD>
<TD> <%= resultset.getString(3) %> </TD>
<TD> <%= resultset.getString(4) %> </TD>
<TD> <%= resultset.getString(5) %> </TD>
<TD> <%= resultset.getString(6) %> </TD>
<TD> <%= resultset.getString(7) %> </TD>
<TD> <%= resultset.getString(8) %> </TD>
<TD> <%= resultset.getString(9) %> </TD>
<TD> <%= resultset.getString(10) %> </TD>
<TD> <%= resultset.getString(11) %> </TD>
<TD> <%= resultset.getString(12) %> </TD>


</TABLE>
</center>


<%
}
%>
<BR>click here goback
<a href="index.jsp" align="right">index page</a>
</BODY>
</HTML>

i want display emp name and number designation seperate on top screen

remaining columns next down screen
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
better to avoid <% in jsp or move this operation code into the servlet or any other service layer.

please have a look Ben Souther Simple Bean Example. this helps to make your code clean and easy to manage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic