基于javaweb+mysql的jsp+servlet人事管理系统(java+javaweb+jdbc)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的JSP+Servlet人事管理系统(java+javaweb+jdbc)
功能介绍:
登录、新增、修改、离职
}
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
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;'>
-->
<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:30%;z-index:9;'>
<center><h2>请输入需要更改信息员工的工号,姓名</h2></center>
<form action="update.jsp" method="post">
<input type="hidden" name="oper" value="1">
<table align="center" width=400>
<tr>
<td width="30%">工号:</td>
<td width="70%"><input type="text" name="empno1"></td>
</tr>
<tr>
<td width="30%">姓名:</td>
<td width="70%"><input type="text" name="ename1"></td>
</tr>
<tr>
<td width="30%"></td>
<td width="70%"><input type="submit" value="查找" /></td>
</tr>
</table>
</form>
</div>
</center>
<%
String oper = request.getParameter("oper");
if ((oper!=null)&&(oper.length()>0)){
request.setCharacterEncoding("utf-8");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER = "root";
rs.close();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
}else{
out.println("请输入工名或姓名,查找员工信息");
}
%>
</body>
</html>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
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 'update.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>
<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
<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>
<td><input type="text" name="sal"></td>
</tr>
<tr>
<td>领导:</td>
<td><input type="text" name="mgr"></td>
</tr>
<tr>
<td>奖金:</td>
<td><input type="text" name="comm"></td>
</tr>
<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>
PreparedStatement pstmt = conn.prepareStatement(sql1);
pstmt.setInt(1,empno);
pstmt.setString(2,ename);
pstmt.setString(3,job);
pstmt.setInt(4,sal);
pstmt.setInt(5,mgr);
pstmt.setInt(6,comm);
pstmt.setString(7,deptno);
pstmt.setString(8,status);
pstmt.setDate(9,hiredate);
pstmt.executeUpdate();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
response.sendRedirect("suc.jsp");
}
%>
</body>
</html>
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"
contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
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 'update.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">
<!--
<td><input type="text" name="job"></td>
</tr>
<tr>
<td>薪水:</td>
<td><input type="text" name="sal"></td>
</tr>
<tr>
<td>领导:</td>
<td><input type="text" name="mgr"></td>
</tr>
<tr>
<td>奖金:</td>
<td><input type="text" name="comm"></td>
</tr>
<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");
<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>
<td><input type="text" name="sal"></td>
</tr>
<tr>
<td>领导:</td>
<td><input type="text" name="mgr"></td>
</tr>
<tr>
<td>奖金:</td>
<td><input type="text" name="comm"></td>
</tr>
<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>
}
%>
</body>
</html>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
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 'update.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>
<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER = "root";
final String DBPASS = "123456";
Connection conn = null;
<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>
<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER = "root";
final String DBPASS = "123456";
Connection conn = null;
if(oper !=null && oper.length()>0){
int empno = Integer.parseInt(request.getParameter("empno"));
String ename = request.getParameter("ename");
int deptno = Integer.parseInt(request.getParameter("deptno"));
try{
Class.forName(DBDRIVER);
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
String sql = "update emp set ename=?,deptno=? where empno=? ";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ename);
pstmt.setInt(2,deptno);
pstmt.setInt(3,empno);
pstmt.executeUpdate();
pstmt.close();
}catch(Exception e){
<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:30%;z-index:9;'>
<center><h2>请输入需要更改信息员工的工号,姓名</h2></center>
<form action="update.jsp" method="post">
<input type="hidden" name="oper" value="1">
<table align="center" width=400>
<tr>
<td width="30%">工号:</td>
<td width="70%"><input type="text" name="empno1"></td>
</tr>
<tr>
<td width="30%">姓名:</td>
<td width="70%"><input type="text" name="ename1"></td>
</tr>
<tr>
<td width="30%"></td>
<td width="70%"><input type="submit" value="查找" /></td>
</tr>
</table>
</form>
</div>
</center>
<%
String oper = request.getParameter("oper");
if ((oper!=null)&&(oper.length()>0)){
request.setCharacterEncoding("utf-8");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
</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); //将日期时间格式化
//String str_date2 = hiredate.toString(); //将Date型日期时间转换成字符串形式
</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); //将日期时间格式化
//String str_date2 = hiredate.toString(); //将Date型日期时间转换成字符串形式
java.util.Date dd = new java.util.Date();
java.sql.Date hiredate = new java.sql.Date(dd.getTime());
final String DBDRIVER1 = "com.mysql.jdbc.Driver";
final String DBURL1 = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER1 = "root";
final String DBPASS1 = "123456";
Connection conn = null;
try{
Class.forName(DBDRIVER1);
conn = DriverManager.getConnection(DBURL1,DBUSER1,DBPASS1);
}finally{
conn.close();
}
response.sendRedirect("suc.jsp");
}else{
int empno = Integer.parseInt(request.getParameter("empno"));
try{
Class.forName(DBDRIVER);
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
String sql = "select ename,deptno from emp where empno = ?";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1,empno);
ResultSet rs = pstmt.executeQuery();
if(rs.next()){
String ename = rs.getString(1);
int deptno = rs.getInt(2);
%>
<center>
<div style='position:absolute;top:20%;left:40%;z-index:9;'>
编辑员工信息
<form action="updatedname.jsp" method="post">
<input type="hidden" name="oper" value="1">
<table>
<tr>
<td>工号:</td>
<td><input type="text" name="empno" readonly="readonly" value="<%=empno %>"></td>
</tr>
<tr>
<td>姓名:</td>
<td><input type="text" name="ename" value="<%=ename %>"></td>
</tr>
<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>
</table>
<input type="submit" value="保存">
RESEARCH
</option>
<option value="30">
SALES
</option>
<option value="40">
OPERATIONS
</option>
</select>
</td>
</tr>
</table>
<input type="submit" value="保存">
<input type="reset" value="重置">
</form>
</div>
</center>
<%
}
rs.close();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
}
%>
</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) {
if ((oper!=null)&&(oper.length()>0)){
request.setCharacterEncoding("utf-8");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER = "root";
final String DBPASS = "123456";
Connection conn = null;
try{
Class.forName(DBDRIVER);
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
//System.out.println(conn);
String sql;
int empno2=Integer.parseInt(request.getParameter("empno1")!="" ? request.getParameter("empno1"):"0");
String ename2 = (request.getParameter("ename1")!="" ? request.getParameter("ename1"): "1");
if((empno2==0)&&(ename2!="1")){
sql = "select empno,ename,deptno,sal,status from emp where ename='"+ename2+"'";
}else if((empno2!=0)&&(ename2=="1")){
sql = "select empno,ename,deptno,sal,status from emp where empno='"+empno2+"'";
}else if((empno2!=0)&&(ename2!="1")){
sql = "select empno,ename,deptno,sal,status from emp where empno='"+empno2+"'";
}else{
sql="";
}
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
%>
<center>
<div style='position:absolute;top:60%;left:30%;z-index:9;'>
<a>查找员工信息</a>
<table border="1" width="600">
<tr>
<td>工号</td>
<td>姓名</td>
<td>部门</td>
<td>薪水</td>
<td>在职</td>
<td colspan="3">操作</td>
</head>
<body class="body-style">
<body>
<%
request.setCharacterEncoding("utf-8");
String oper = request.getParameter("oper");
final String DBDRIVER = "com.mysql.jdbc.Driver";
final String DBURL = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
final String DBUSER = "root";
final String DBPASS = "123456";
Connection conn = null;
if(oper !=null && oper.length()>0){
int empno = Integer.parseInt(request.getParameter("empno"));
String ename = request.getParameter("ename");
int deptno = Integer.parseInt(request.getParameter("deptno"));
try{
Class.forName(DBDRIVER);
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
String sql = "update emp set ename=?,deptno=? where empno=? ";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ename);
pstmt.setInt(2,deptno);
pstmt.setInt(3,empno);
pstmt.executeUpdate();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
response.sendRedirect("suc.jsp");
}else{
int empno = Integer.parseInt(request.getParameter("empno"));
try{
Class.forName(DBDRIVER);
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
String sql = "select ename,deptno from emp where empno = ?";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1,empno);
%>
</body>
</html>
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"
contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
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 'update.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:30%;z-index:9;'>
<center><h2>请输入需要更改信息员工的工号,姓名</h2></center>
<form action="update.jsp" method="post">
<input type="hidden" name="oper" value="1">
<table align="center" width=400>
<tr>
<td width="30%">工号:</td>
<td width="70%"><input type="text" name="empno1"></td>
</tr>
<tr>
<td width="30%">姓名:</td>
<td width="70%"><input type="text" name="ename1"></td>
</tr>
<tr>
<td width="30%"></td>
<td width="70%"><input type="submit" value="查找" /></td>
PreparedStatement pstmt = conn.prepareStatement(sql1);
pstmt.setInt(1,empno);
pstmt.setString(2,ename);
pstmt.setString(3,job);
pstmt.setInt(4,sal);
pstmt.setInt(5,mgr);
pstmt.setInt(6,comm);
pstmt.setString(7,deptno);
pstmt.setString(8,status);
pstmt.setDate(9,hiredate);
pstmt.executeUpdate();
pstmt.close();
}catch(Exception e){
out.println(e);
}finally{
conn.close();
}
response.sendRedirect("suc.jsp");
}
%>
</body>
</html>
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"
contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
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 'update.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">