基于javaweb的JSP+Servlet校园学生兼职系统(学生、企业、管理员)(java+servlet+dwr+jsp+javascript+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

482023190609

492023190609

502023190609

512023190609

532023190609

542023190609

552023190609

562023190609

572023190609

582023190609

基于javaweb的JSP+Servlet校园学生兼职系统(学生、企业、管理员)(java+servlet+dwr+jsp+javascript+mysql)

管理员:
admin 123456

企业:
company1 123456
company2 123456

用户:
user1 123456
user2 123456

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
		    }
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("qiyeList", qiyeList);
req.getRequestDispatcher("qiye/qiyeUpdate.jsp").forward(req, res);
}

public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request, response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
catch (IOException e)
{

e.printStackTrace();
}
}
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}

public void destroy()
{

}
}

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
	}
finally
{
mydb.closed();
}
}
if(userType==2)
{
String sql="select * from yonghu where yhdengluName=? and yhdengluPass=?";
Object[] params={userName,userPw};
DB mydb=new DB();
mydb.doPstm(sql, params);
try
{
ResultSet rs=mydb.getRs();
boolean mark=(rs==null||!rs.next()?false:true);
if(mark==false)
{
result="no";
}
else
{
result="yes";
Tyonghu xuesheng=new Tyonghu();
xuesheng.setyhid(rs.getInt("yhid"));
xuesheng.setyhdengluName(rs.getString("yhdengluName"));
xuesheng.setyhdengluPass(rs.getString("yhdengluPass"));
xuesheng.setyhxingming(rs.getString("yhxingming"));
xuesheng.setyhxingbie(rs.getString("yhxingbie"));
xuesheng.setyhnianling(rs.getString("yhnianling"));
xuesheng.setyhxuexiao(rs.getString("yhxuexiao"));
xuesheng.setyhzhuanye(rs.getString("yhzhuanye"));
xuesheng.setyhdianhua(rs.getString("yhdianhua"));
xuesheng.setyhweixin(rs.getString("yhweixin"));
xuesheng.setyhjieshao(rs.getString("yhjieshao"));
WebContext ctx = WebContextFactory.get();
HttpSession session=ctx.getSession();
session.setAttribute("userType", 2);
session.setAttribute("xuesheng", xuesheng);
}
rs.close();
}
catch (SQLException e)
{
System.out.println("登录失败");
e.printStackTrace();
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
52
53
54
	String zwzhuangtai="未审核";
String zwfaburiqi=new SimpleDateFormat("yyyy-MM-dd").format(new Date());

String sql="insert into zhiwei(zwmingcheng,zwleixing,quyuID,zwxinzi,zwrenshu,zwdizhi,zwzhize,zwyaoqiu,zwzhuangtai,zwfaburiqi,qiyeID) values(?,?,?,?,?,?,?,?,?,?,?)";//插入语句
Object[] params={zwmingcheng,zwleixing,quyuID,zwxinzi,zwrenshu,zwdizhi,zwzhize,zwyaoqiu,zwzhuangtai,zwfaburiqi,qiyeID};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "添加成功");
req.setAttribute("path", "zhiwei?type=zhiweiMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void zhiweiUpdate(HttpServletRequest req,HttpServletResponse res)
{
String id=req.getParameter("id");
String zwmingcheng=req.getParameter("zwmingcheng");
String zwleixing=req.getParameter("zwleixing");
String quyuID=req.getParameter("quyuID");
String zwxinzi=req.getParameter("zwxinzi");
String zwrenshu=req.getParameter("zwrenshu");
String zwdizhi=req.getParameter("zwdizhi");
String zwzhize=req.getParameter("zwzhize");
String zwyaoqiu=req.getParameter("zwyaoqiu");

String sql="update zhiwei set zwmingcheng=?,zwleixing=?,quyuID=?,zwxinzi=?,zwrenshu=?,zwdizhi=?,zwzhize=?,zwyaoqiu=? where zwid=?";
Object[] params={zwmingcheng,zwleixing,quyuID,zwxinzi,zwrenshu,zwdizhi,zwzhize,zwyaoqiu,id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "修改成功");
req.setAttribute("path", "zhiwei?type=zhiweiMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void zhiweiDel(HttpServletRequest req,HttpServletResponse res)
{
String id=req.getParameter("id");
String sql="delete from zhiwei where zwid=?";
Object[] params={id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();

req.setAttribute("message", "删除成功");
req.setAttribute("path", "zhiwei?type=zhiweiMana");

String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void zhiweiInfo(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
Tzhiwei zhiwei=new Tzhiwei();
int quyuID=0;
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
52
53
54
	{
mydb.closed();
mydb1.closed();
}
req.setAttribute("message", "修改成功");
req.setAttribute("path", "qiye?type=qiyeXinxi");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void qiyeDel(HttpServletRequest req,HttpServletResponse res)
{
String id=req.getParameter("id");
String sql="delete from qiye where qyid=?";
Object[] params={id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "删除成功");
req.setAttribute("path", "qiye?type=qiyeMana");
String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void qiyeMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List qiyeList=new ArrayList();
String sql="select * from qiye"; //查询语句
Object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
Tqiye qiye=new Tqiye();
qiye.setqyid(rs.getInt("qyid"));
qiye.setqydengluName(rs.getString("qydengluName"));
qiye.setqymingcheng(rs.getString("qymingcheng"));
qiye.setqydizhi(rs.getString("qydizhi"));
qiye.setqydianhua(rs.getString("qydianhua"));
qiye.setqylianxiren(rs.getString("qylianxiren"));
qiye.setqyhangye(rs.getString("qyhangye"));
qiye.setqyguimo(rs.getString("qyguimo"));
qiye.setqyjieshao(rs.getString("qyjieshao"));
qiyeList.add(qiye);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("qiyeList", qiyeList);
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
			shenqing.setzhiweiID(rs.getInt("zhiweiID"));	
shenqing.setzwmingcheng(rs.getString("zwmingcheng"));
shenqing.setqymingcheng(rs.getString("qymingcheng"));
shenqing.setzwxinzi(rs.getString("zwxinzi"));;
shenqing.setzwdizhi(rs.getString("zwdizhi"));
shenqing.setsqshijian(rs.getString("sqshijian"));
shenqing.setsqzhuangtai(rs.getString("sqzhuangtai"));
shenqingList.add(shenqing);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("shenqingList", shenqingList);
req.getRequestDispatcher("xuesheng/myshenqing.jsp").forward(req, res);
}
public void shenqingList(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List shenqingList=new ArrayList();
HttpSession session=req.getSession();
Tqiye qiye=(Tqiye)session.getAttribute("qiye");
int qiyeID=qiye.getqyid();

String sql="select a.*,b.zwmingcheng,c.yhxingming,c.yhxingbie,c.yhnianling,c.yhxuexiao,c.yhzhuanye,c.yhdianhua,c.yhweixin,c.yhjieshao from shenqing a left join zhiwei b on a.zhiweiID=b.zwid left join yonghu c on a.xueshengID=c.yhid where a.zhiweiID in(select zwid from zhiwei where qiyeID=?)"; //查询语句
Object[] params={qiyeID};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
Tshenqing shenqing=new Tshenqing();

shenqing.setsqid(rs.getInt("sqid"));
shenqing.setzwmingcheng(rs.getString("zwmingcheng"));
shenqing.setyhxingming(rs.getString("yhxingming"));
shenqing.setyhxingbie(rs.getString("yhxingbie"));
shenqing.setyhnianling(rs.getString("yhnianling"));


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