Meaningless Drivel is fun!*
The moose likes JSP and the fly likes I want to display the details of employee. in prescribed format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "I want to display the details of employee. in prescribed format" Watch "I want to display the details of employee. in prescribed format" New topic
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: 1321

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..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want to display the details of employee. in prescribed format
 
Similar Threads
replacing %20 in a string
There is no Action mapped for namespace ... and action name ...
Jsp and Oracle 10 G
How to send a image file to theservlet
java:12: cannot find symbol