Git Product home page Git Product logo

stugrademanagement's Introduction

学生成绩管理系统

avaEE学生成绩管理系统项目,基于Servlet、JSP、Spring框架.

24.1.6重大更新

项目改为采用jdk11,jdk8仍可用,但需要在IDEA的File->Project Structure中配置。

9.14 重大更新

在数据库Users表中增加字段用于表示用户在一段时间内的失败次数和上次失败时间,详情见sql代码部分。


目标:通过采用json返回数据等方式尽量减少jsp页面

支持功能:查询学生信息(支持分页),查询学生分数、查询课程、增加学生考试信息、增加课程(仅管理员)等

环境信息

名称
语言 Java(JDK11)
操作系统 MS Windows 10
IDE IntelliJ IDEA 2021.3 Ultimate
数据库 MySQL 8.0
服务器 Apache tomcat 9.0.71
项目管理工具 Maven 3

使用教程

  1. 首先按上面的表格配置好环境(你也可以选不同版本,但不保证能正常运行)。
  2. 新建名为stuDB的数据库,并在其中加入表:
create table student
(
    id      int auto_increment
        primary key,
    sname   varchar(255)               not null,
    gender  varchar(255)               not null,
    address varchar(255)               null,
    age     tinyint unsigned           not null,
    qq      varchar(10) charset latin1 null,
    phone   varchar(11) charset latin1 null
) AUTO_INCREMENT = 2000 CHARACTER SET = utf8mb4;

create table users
(
    id         int auto_increment primary key,
    username   varchar(255) not null,
    `password` varchar(100) not null,
    isadmin    tinyint(1) unsigned default 0 null,
    last_err_time bigint null,
    err_count     int default 0 null
) AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4;

CREATE TABLE `course` (
  `id` int NOT NULL AUTO_INCREMENT,
  `cname` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
  `ctype` varchar(10) CHARACTER SET utf8mb4 NOT NULL COMMENT '课程类型:公共课、专业基础课、专业课、选修课',
  `teacher` int(0) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  CONSTRAINT `TEA_ID` FOREIGN KEY (`teacher`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) CHARACTER SET = utf8mb4;

create table grade
(
   stuid    int              not null
      primary key,
   courseid int              not null,
   score    tinyint unsigned null comment '分数为空代表考试异常',
   constraint COURSE_ID
      foreign key (courseid) references course (id)
         on update cascade,
   constraint STU_ID
      foreign key (stuid) references student (id)
         on update cascade
);
  1. 本项目使用了Tomcat自带连接池。在tomcat安装目录下conf文件夹中的context.xml文件中<Context>条目下加入以下内容
<Resource name="jdbc/Stu" auth="Container"  
          type="javax.sql.DataSource" maxActive="100" maxIdle="30"  
          maxWait="10000" username="" password=""  
          driverClassName="com.mysql.cj.jdbc.Driver" 
          url="jdbc:mysql://localhost:3306/StuDB"/>

记得把usernamepassword改为你数据库的用户名和密码。最后一行可换成你的数据库地址。 4. 在IDEA中新建JavaEE项目,添加Servlet、Spring依赖,并配置好Tomcat。这个网上教程很多,不再赘述。注意http端口号为80 5. 在IDEA的Project Structure->Modules->Dependencies中加入Tomcat安装目录下的lib目录。 6. 在src/main/resources目录下新建jdbc.properties文件,存入以下内容

    driverClassName=com.mysql.cj.jdbc.Driver
    url=jdbc:mysql://localhost:3306/stdDB?characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
    username=你的数据库用户名
    password=你的数据库密码

注意事项

  • 本项目所有用户密码均使用MD5+SHA256加密后存储在数据库中,如要在数据库中新建用户,请不要忘了加密。
  • 本项目前端不考虑旧版浏览器(如IE9以下版本)兼容性(Updated 230524:经实测IE11正常)
  • 本项目使用MIT协议。

参考

teacher.jsp等 前端设计
course.jsp表格设计
出错页面

欢迎提出意见与建议

stugrademanagement's People

Contributors

remaker01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar 宇宙超级无敌暴龙战士 avatar

Watchers

 avatar

stugrademanagement's Issues

11

求救 我也不懂哪里出了问题 java: 程序包com.sun.istack.internal不存在

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.