基于javaweb的JSP+Servlet人事管理系统(java+javaweb+mysql+jdbc)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

210023272402

220023272402

230023272402

基于javaweb的JSP+Servlet人事管理系统(java+javaweb+mysql+jdbc)

功能介绍:

登录、新增、修改、离职

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    			<tr>
<td>部门编号:</td>
<td><select name="deptno">
<option value="10">
ACCOUNTING
</option>
<option value="20">
RESEARCH
</option>
<option value="30">
SALES
</option>
<option value="40">
OPERATIONS
</option>
</select>
</td>
</tr>
<tr>
<td>在职:</td>
<td><input type="text" name="status" value="是"></td>
</tr>

</table>
<input type="submit" value="保存">
<input type="reset" value="重置">
</form>
</div>
</center>

<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
if(oper !=null && oper.length() > 0){
int empno = Integer.parseInt(request.getParameter("empno"));
String ename = request.getParameter("ename");
String job = request.getParameter("job");
int sal = Integer.parseInt(request.getParameter("sal"));
//int mgr=Integer.parseInt(request.getParameter("mgr"));
int comm = Integer.parseInt(request.getParameter("comm"));
String deptno = request.getParameter("deptno");
String status = request.getParameter("status");


//java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

<style type="text/css">
.body-style{background-image:url(images/timg3.jpg);background-size:100% 100%;}
</style>

</head>
<body class="body-style">

<body>




<center>
<div style='position:absolute;top:20%;left:40%;z-index:9;'>
新增员工
<form action="add.jsp" method="post">
<input type="hidden" name="oper" value="1">
<table>
<tr>
<td>工号:</td>
<td><input type="text" name="empno"></td>
</tr>
<tr>
<td>姓名:</td>
<td><input type="text" name="ename"></td>
</tr>
<tr>
<td>职位:</td>
<td><input type="text" name="job"></td>
</tr>
<tr>
<td>薪水:</td>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
	  			<td><%=empno %></td>
<td><%=ename %></td>
<td><%=deptno %></td>
<td><%=sal %></td>
<td><%=status %></td>
<td><a href="updatesal.jsp?empno=<%=empno %>">更改工资</a></td>
<td><a href="updatedname.jsp?empno=<%=empno %>">更改部门</a></td>
<td><a href="updatestatus.jsp?empno=<%=empno %>">离职</a></td>
</tr>
</table>
</div>
</center>
<%
}
rs.close();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
}else{
out.println("请输入工名或姓名,查找员工信息");
}
%>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=PT+Sans:400,700,400italic,700italic|Oswald:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
<!--//webfonts-->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	  <%
while(rs.next()){
int empno = rs.getInt(1);
String ename = rs.getString(2);
int deptno = rs.getInt(3);
int sal = rs.getInt(4);
String status = rs.getString(5);
%>
<tr>
<td><%=empno %></td>
<td><%=ename %></td>
<td><%=deptno %></td>
<td><%=sal %></td>
<td><%=status %></td>
<td><a href="updatesal.jsp?empno=<%=empno %>">更改工资</a></td>
<td><a href="updatedname.jsp?empno=<%=empno %>">更改部门</a></td>
<td><a href="updatestatus.jsp?empno=<%=empno %>">离职</a></td>
</tr>
</table>
</div>
</center>
<%
}
rs.close();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
}else{
out.println("请输入工名或姓名,查找员工信息");
}
%>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!--webfonts-->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    			<tr>
<td>部门编号:</td>
<td><select name="deptno">
<option value="10">
ACCOUNTING
</option>
<option value="20">
RESEARCH
</option>
<option value="30">
SALES
</option>
<option value="40">
OPERATIONS
</option>
</select>
</td>
</tr>
<tr>
<td>在职:</td>
<td><input type="text" name="status" value="是"></td>
</tr>

</table>
<input type="submit" value="保存">
<input type="reset" value="重置">
</form>
</div>
</center>

<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
if(oper !=null && oper.length() > 0){
int empno = Integer.parseInt(request.getParameter("empno"));
String ename = request.getParameter("ename");
String job = request.getParameter("job");
int sal = Integer.parseInt(request.getParameter("sal"));
//int mgr=Integer.parseInt(request.getParameter("mgr"));
int comm = Integer.parseInt(request.getParameter("comm"));
String deptno = request.getParameter("deptno");
String status = request.getParameter("status");


//java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// java.util.Date hiredate = new java.util.Date();//得到当前系统时间
//String str_date1 = formatter.format(hiredate); //将日期时间格式化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
		}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
}else{
out.println("请输入工名或姓名,查找员工信息");
}
%>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=PT+Sans:400,700,400italic,700italic|Oswald:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
<!--//webfonts-->
</head>
<body>
<script>$(document).ready(function(c) {
$('.close').on('click', function(c){
$('.login-form').fadeOut('slow', function(c){
$('.login-form').remove();
});
});
});
</script>
<!--SIGN UP-->
<h1>klasikal Login Form</h1>
<div class="login-form">
<div class="close"> </div>
<div class="head-info">
<label class="lbl-1"> </label>
<label class="lbl-2"> </label>
<label class="lbl-3"> </label>
</div>
<div class="clear"> </div>


项目链接:
https://javayms.github.io?id=301422302105200gi
https://javayms.pages.dev?id=301422302105200gi