博主24h在线,想要源码文档部署视频直接私聊,9.9元拿走!
基于javaweb+mysql的jsp+servlet学生成绩管理系统(管理员、教师、学生)(java+jsp+servlet+javabean+mysql+tomcat)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明 三个角色
管理员:个人信息、课程管理、成绩管理、教师管理、学生管理
教师:个人信息、课程管理、成绩管理、学生信息查看
学生:人个信息管理、成绩查询
技术框架
JSP Servlet MySQL JDBC Tomcat CSS JavaScript bootstrap jquery
基于javaweb+mysql的JSP+Servlet学生成绩管理系统(管理员、教师、学生)(java+jsp+servlet+javabean+mysql+tomcat)
java
public class ServletEditCos extends HttpServlet{
private Course course;
private ServletFindAllCos servletFindAllCos=new ServletFindAllCos();
private ServletSelectCos selectOne=new ServletSelectCos();
private CourseServiceImpl courseServiceImpl=new CourseServiceImpl();
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
int courseID=Integer.parseInt(request.getParameter("courseID"));
String courseName = request.getParameter("courseName");
int courseCredit = Integer.parseInt(request.getParameter("courseCredit"));
int courseHours = Integer.parseInt(request.getParameter("courseHours"));
String courseTea = request.getParameter("courseTea");
String coDate = request.getParameter("courseDate");
Date courseDate = null;
try {
courseDate = new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("courseDate"));
} catch (ParseException e) {
e.printStackTrace();
}
course=new Course(courseID,courseName,courseCredit,courseHours,courseTea,courseDate);
int rs=courseServiceImpl.editCos(course,coDate);
if(rs>0){
request.setAttribute("msg", "修改成功!!");
servletFindAllCos.doGet(request, response);
// request.getRequestDispatcher("admin/addCourse.jsp").forward(request, response);
}else{
return "SF";
}
return null;
}
}
public class ServletaddTeacher extends HttpServlet{
private User user;
private Teacher teacher;
private UserServiceImpl userServiceImpl = new UserServiceImpl();
private TeacherServiceImpl teacherServiceImpl =new TeacherServiceImpl();
private ServletFindAllTea findTea=new ServletFindAllTea();
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String teaNum = request.getParameter("teaNum");
String teaName = request.getParameter("teaName");
String pwd = request.getParameter("password");
String teaSex = request.getParameter("teaSex");
int teaAge = Integer.parseInt(request.getParameter("teaAge"));
String teaCourse = request.getParameter("teaCourse");
String major = request.getParameter("major");
String department = request.getParameter("department");
String phone = request.getParameter("phone");
int roleID = Integer.parseInt(request.getParameter("role"));
user = new User(teaNum, teaName, pwd, phone, roleID);
teacher = new Teacher(teaNum, teaName, teaSex, teaAge, teaCourse, major,
department);
//验证是否存在该教师
User rs=userServiceImpl.login(user);
}