Java+Servlet+JSP+Mysql+Tomcat实现Web学生选课管理系统
Posted 水坚石青
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java+Servlet+JSP+Mysql+Tomcat实现Web学生选课管理系统相关的知识,希望对你有一定的参考价值。
一、系统介绍
1.软件环境
Java:jdk1.8
mysql:8.0.13
Tomcat:8.5.23
2.系统功能
学生
1.查看个人信息
2.选课
3.查看已选课程
教师
1.查看个人信息
2.评分
3.查看任课课程
管理员
1.管理员功能
(1).查看个人信息
(2).添加新的管理员
2.学生功能
(1).添加学生
(2).获取所有学生
3.课程功能
(1).添加课程
(2).查询课程
4.教师功能
(1).添加教师
(2)获取所有教师
3.数据库
/*
Navicat Premium Data Transfer
Source Server : MySQL
Source Server Type : MySQL
Source Server Version : 80013
Source Host : localhost:3306
Source Schema : jsp_servlet_selectcourse
Target Server Type : MySQL
Target Server Version : 80013
File Encoding : 65001
Date: 23/06/2021 20:46:30
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`userid` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`username` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`age` int(3) NULL DEFAULT NULL,
`score` decimal(5, 1) NULL DEFAULT NULL,
`introduction` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`enterdate` date NULL DEFAULT NULL,
PRIMARY KEY (`userid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_admin
-- ----------------------------
INSERT INTO `t_admin` VALUES ('admin', '管理员', 'admin', 21, 100.0, ' ', '2018-06-12');
INSERT INTO `t_admin` VALUES ('admin1', '水坚石青', 'admin1', 25, 99.0, '', '2021-06-22');
-- ----------------------------
-- Table structure for t_class
-- ----------------------------
DROP TABLE IF EXISTS `t_class`;
CREATE TABLE `t_class` (
`classno` int(4) NOT NULL AUTO_INCREMENT,
`cname` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`cteacher` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`classroom` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`classno`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1531 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_class
-- ----------------------------
INSERT INTO `t_class` VALUES (1520, '软工', '赵丽', '综阶1');
INSERT INTO `t_class` VALUES (1521, '软工', '齐兴斌', '综阶2');
INSERT INTO `t_class` VALUES (1522, '软工', '张志斌', '综阶3');
INSERT INTO `t_class` VALUES (1523, '软工', '郭小英', '综阶5');
INSERT INTO `t_class` VALUES (1524, '软工', '郭新峰', '综阶6');
INSERT INTO `t_class` VALUES (1525, '软工', '王若慧', '综阶7');
INSERT INTO `t_class` VALUES (1526, '软工', '贾春华', '综阶8');
INSERT INTO `t_class` VALUES (1527, '软工', '朱云雷', '综阶9');
INSERT INTO `t_class` VALUES (1528, '软工', '李雪梅', '综阶10');
INSERT INTO `t_class` VALUES (1529, '软工', '张举 ', '综阶11');
INSERT INTO `t_class` VALUES (1530, '软工', '米晓萍', '综阶12');
INSERT INTO `t_class` VALUES (1531, '软工', '张建英', '综阶13');
-- ----------------------------
-- Table structure for t_course
-- ----------------------------
DROP TABLE IF EXISTS `t_course`;
CREATE TABLE `t_course` (
`cno` int(4) NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`credit` int(1) NULL DEFAULT NULL,
`periodstart` date NULL DEFAULT NULL,
`periodend` date NULL DEFAULT NULL,
PRIMARY KEY (`cno`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1009 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_course
-- ----------------------------
INSERT INTO `t_course` VALUES (1001, '数据库', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1002, '数据结构', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1003, 'j2ee', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1004, '计算机网络', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1005, '计算机组成原理', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1007, '编译原理', 4, '2018-02-01', '2018-08-08');
INSERT INTO `t_course` VALUES (1008, 'C语言', 4, '2018-02-01', '2018-02-01');
INSERT INTO `t_course` VALUES (1009, 'c++', 4, '2018-01-02', '2018-05-28');
INSERT INTO `t_course` VALUES (1010, '1', 1, '2021-06-22', '2021-06-22');
-- ----------------------------
-- Table structure for t_sc
-- ----------------------------
DROP TABLE IF EXISTS `t_sc`;
CREATE TABLE `t_sc` (
`sno` int(10) NOT NULL,
`cno` int(4) NOT NULL,
`tno` int(4) NOT NULL,
`score` decimal(5, 2) NULL DEFAULT NULL,
PRIMARY KEY (`sno`, `cno`, `tno`) USING BTREE,
INDEX `t_sc_ibfk_2`(`cno`) USING BTREE,
INDEX `t_sc_ibfk_3`(`tno`) USING BTREE,
CONSTRAINT `t_sc_ibfk_1` FOREIGN KEY (`sno`) REFERENCES `t_student` (`sno`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `t_sc_ibfk_2` FOREIGN KEY (`cno`) REFERENCES `t_course` (`cno`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `t_sc_ibfk_3` FOREIGN KEY (`tno`) REFERENCES `t_teacher` (`tno`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_sc
-- ----------------------------
INSERT INTO `t_sc` VALUES (2015001, 1002, 1001, 100.00);
INSERT INTO `t_sc` VALUES (2015001, 1004, 1001, 99.00);
INSERT INTO `t_sc` VALUES (2015001, 1004, 1006, NULL);
INSERT INTO `t_sc` VALUES (2015001, 1005, 1002, NULL);
INSERT INTO `t_sc` VALUES (2015001, 1007, 1004, NULL);
INSERT INTO `t_sc` VALUES (2015001, 1008, 1002, NULL);
INSERT INTO `t_sc` VALUES (2015001, 1008, 1004, NULL);
INSERT INTO `t_sc` VALUES (2015001, 1008, 1005, NULL);
-- ----------------------------
-- Table structure for t_student
-- ----------------------------
DROP TABLE IF EXISTS `t_student`;
CREATE TABLE `t_student` (
`sno` int(9) NOT NULL AUTO_INCREMENT,
`password` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`sname` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`phone` bigint(11) NULL DEFAULT NULL,
`sex` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`birthday` date NULL DEFAULT NULL,
`classno` int(4) NULL DEFAULT NULL,
`remark` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`sno`) USING BTREE,
INDEX `t_student_ibfk_1`(`classno`) USING BTREE,
CONSTRAINT `t_student_ibfk_1` FOREIGN KEY (`classno`) REFERENCES `t_class` (`classno`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 2015570 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_student
-- ----------------------------
INSERT INTO `t_student` VALUES (2015001, '123456', '李四', 15788888888, '女', '2021-06-22', 1525, '优秀');
INSERT INTO `t_student` VALUES (2015002, '123456', '王茹', 15788888888, '女', '2018-05-28', 1520, '良好');
INSERT INTO `t_student` VALUES (2015003, '123456', '张三', 15788888888, '女', '2018-05-28', 1520, '良好');
INSERT INTO `t_student` VALUES (2015004, '123456', '王五', 15788888888, '女', '2018-05-28', 1520, '优秀');
INSERT INTO `t_student` VALUES (2015005, '123456', '李浩', 15788888888, '女', '2018-05-28', 1520, '合格');
INSERT INTO `t_student` VALUES (2015006, '123456', '黄县', 15788888888, '女', '2018-05-28', 1520, '良好');
INSERT INTO `t_student` VALUES (2015007, '123456', '钱一', 15788888888, '女', '2018-05-28', 1520, '优秀');
INSERT INTO `t_student` VALUES (2015009, '123456', '赵括', 15788888888, '女', '2018-05-28', 1520, '优秀');
INSERT INTO `t_student` VALUES (2015010, '123456', '赵括', 15788888888, '女', '2018-05-28', 1520, '优秀');
-- ----------------------------
-- Table structure for t_tc
-- ----------------------------
DROP TABLE IF EXISTS `t_tc`;
CREATE TABLE `t_tc` (
`cno` int(4) NOT NULL,
`tno` int(4) NOT NULL,
PRIMARY KEY (`cno`, `tno`) USING BTREE,
INDEX `t_tc_ibfk_2`(`tno`) USING BTREE,
CONSTRAINT `t_tc_ibfk_1` FOREIGN KEY (`cno`) REFERENCES `t_course` (`cno`) ON DELETE 带有 Servlet、JSP 和 MySQL 的 Java 中的 CRUD Web 应用程序,没有 DAO
解决javax.servlet.jsp.JspException cannot be resolved to a type
Java实现Web航空订票系统(servlet+jdbc+jsp+mysql)