一、系统介绍
本系统实现的以下功能
登录功能:教务人员登录、注销;教师登录、注销;学生登录,注销。
教务人员功能:对学生成绩的查看、修改,学生信息的增删改查,教师信息的增删改查,
教务人员的增删,排课信息的增删改查,课程信息的增删改查,班级信息的增删改查;
教师模块功能:发布学生成绩,查看个人信息,修改密码;
学生模块功能:选择课程,查看个人信息,修改密码,查询成绩,查看已选课程。
JDK版本:1.8
数据库:Mysql8.0.13
二、系统展示
1.登录页
2.主页面-教务人员
3.学生成绩管理-教务人员
4.学生信息管理-教务人员
5.教师信息管理-教务人员
6.教务人员信息管理-教务人员
7.排课信息管理-教务人员
8.课程信息管理-教务人员
9.班级信息管理-教务人员
10.关于系统-教务人员
11.主页面-教师模块
12.学生成绩发布-教师模块
13.个人信息查看-教师模块
14.密码修改-教师模块
15.主页面-学生模块
16.课程选择-学生模块
17.个人信息查看-学生模块
18.密码修改-学生模块
19.成绩查看-学生模块
20.已选课程查看-学生模块
三、系统实现
IUserInfoDAO.java
package com.sjsq.dao; import java.util.List; import com.sjsq.entity.UserInfo; /** * * @author HZBIN1993 * * @author shuijianshiqing * * @date 2021-01-09 * */ public interface IUserInfoDAO { /** * 数据库的增加 * * @param user * @return */ public boolean doCreate(UserInfo user) throws Exception; /** * 修改用户 * * @param user * @return * @throws Exception */ public boolean doUpdate(UserInfo user) throws Exception; /** * * 删除用户 * * @param user * @return * @throws Exception */ public boolean doDelete(String username) throws Exception; /** * 数据库查询操作 * * @param id * @return * @throws Exception */ public UserInfo findById(String id) throws Exception; /** * 做查询操作 * * @param id * @return * @throws Exception */ public List<UserInfo> findAll(String keyword) throws Exception; }
UserInfoDaoImpI.java
package com.sjsq.dao.ImpI; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import com.sjsq.dao.IUserInfoDAO; import com.sjsq.entity.UserInfo; public class UserInfoDaoImpI implements IUserInfoDAO { private Connection conn = null; public UserInfoDaoImpI(Connection conn) { this.conn = conn; } @Override public boolean doCreate(UserInfo user) throws Exception { // Auto-generated method stub // 增加信息 boolean flag = false; PreparedStatement pstmt = null; String sql = "INSERT INTO UserInfo_tab(userName ,NickName,UserPass,grade)VALUES(?,?,?,?)"; try { pstmt = this.conn.prepareStatement(sql); pstmt.setString(1, user.getUserName()); pstmt.setString(2, user.getNickName()); pstmt.setString(3, user.getUserPass()); pstmt.setInt(4, user.getGrade()); if (pstmt.executeUpdate() > 0) { flag = true; } } catch (Exception e) { throw e; } finally { try { if (pstmt != null) { pstmt.close(); } } catch (Exception e) { } } return flag; } @Override public boolean doUpdate(UserInfo user) throws Exception { // 更新用户信息 boolean flag = false; PreparedStatement pstmt = null; String sql = "UPDATE UserInfo_tab SET UserPass=? WHERE UserName=?"; try { pstmt = this.conn.prepareStatement(sql); pstmt.setString(1, user.getUserPass()); pstmt.setString(2, user.getUserName()); if (pstmt.executeUpdate() > 0) { flag = true; } } catch (Exception e) { throw e; } finally { try { if (pstmt != null) { pstmt.close(); } } catch (Exception e) { } } return flag; } @Override public boolean doDelete(String username) throws Exception { // 删除用户信息 boolean flag = false; PreparedStatement pstmt = null; String sql = "DELETE FROM UserInfo_tab WHERE UserName=?"; try { pstmt = this.conn.prepareStatement(sql); pstmt.setString(1, username); if (pstmt.executeUpdate() > 0) { flag = true; } } catch (Exception e) { throw e; } finally { try { if (pstmt != null) { pstmt.close(); } } catch (Exception e) { } } return flag; } @Override public List<UserInfo> findAll(String keyword) throws Exception { // 查找用户信息-关键字查找 List<UserInfo> all = new ArrayList<UserInfo>(); PreparedStatement pstmt = null; String sql = "SELECT ID,UserName,NickName,UserPass,Grade WHERE UserName LIKE ? OR NickName LIKE ?"; try { pstmt = this.conn.prepareStatement(sql); pstmt.setString(1, "%" + keyword + "%"); pstmt.setString(2, "%" + keyword + "%"); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { UserInfo user = new UserInfo(); user.setID(rs.getInt(1)); user.setUserName(rs.getString(2)); user.setNickName(rs.getString(3)); user.setUserPass(rs.getString(4)); user.setGrade(rs.getInt(5)); all.add(user); } rs.close(); } catch (Exception e) { throw e; } finally { try { if (pstmt != null) { pstmt.close(); } } catch (Exception e) { } } return all; } // @Override public UserInfo findById(String id) throws Exception { // 查找用户信息-ID查找 UserInfo user = null; PreparedStatement pstmt = null; String sql = "SELECT * FROM UserInfo_tab WHERE UserName=?"; try { pstmt = this.conn.prepareStatement(sql); pstmt.setString(1, id); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { user = new UserInfo(); user.setID(rs.getInt(1)); user.setUserName(rs.getString(2)); user.setNickName(rs.getString(3)); user.setUserPass(rs.getString(4)); user.setGrade(rs.getInt(5)); } rs.close(); } catch (Exception e) { throw e; } finally { try { if (pstmt != null) { pstmt.close(); } } catch (Exception e) { } } return user; } }