| Author |
I want to display the details of employee. in prescribed format
|
sureshkumarneeli kumar
Greenhorn
Joined: Sep 30, 2011
Posts: 7
|
|
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
Joined: Jul 14, 2010
Posts: 754
|
|
Hello sureshkumarneeli kumar,
I could you post the JSP code again?
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
sureshkumarneeli kumar
Greenhorn
Joined: Sep 30, 2011
Posts: 7
|
|
<%@ 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
Joined: Dec 06, 2005
Posts: 1318
|
|
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.
|
Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
|
 |
 |
|
|
subject: I want to display the details of employee. in prescribed format
|
|
|