diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/.gitignore" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..35410cacdc5e87f985c93a96520f5e11a5c822e4 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/.gitignore" @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/artifacts/Day0606_war_exploded.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/artifacts/Day0606_war_exploded.xml" new file mode 100644 index 0000000000000000000000000000000000000000..2c3bcc5007a22c73b080f072fec935a79cd0545d --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/artifacts/Day0606_war_exploded.xml" @@ -0,0 +1,13 @@ + + + $PROJECT_DIR$/out/artifacts/Day0606_war_exploded + + + + + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/dataSources.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/dataSources.xml" new file mode 100644 index 0000000000000000000000000000000000000000..8dc58e7f47f1db33050c72bf2a3cdc1bab807e17 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/dataSources.xml" @@ -0,0 +1,12 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306 + $ProjectFileDir$ + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/libraries/lib.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/libraries/lib.xml" new file mode 100644 index 0000000000000000000000000000000000000000..23106033b23a0c8e5ae95ddf611aebd76dc3d72f --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/libraries/lib.xml" @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/misc.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..05483570e041eb648703359441d61bf9a5feeb13 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/misc.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/modules.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..762427240d1b76e7ae3691bed5a09f652bdd80d1 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/webContexts.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/webContexts.xml" new file mode 100644 index 0000000000000000000000000000000000000000..322627a55ca2a5019b36c0a7768663aa0a42557c --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/.idea/webContexts.xml" @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/Day0606.iml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/Day0606.iml" new file mode 100644 index 0000000000000000000000000000000000000000..bc73df7611ec684b1bbe278ef7410a3c374a9849 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/Day0606.iml" @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/SQL.sql" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/SQL.sql" new file mode 100644 index 0000000000000000000000000000000000000000..93240074eeb8b55f875dc76300e2676a9a85b7e2 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/SQL.sql" @@ -0,0 +1,31 @@ +# 创建AttDB数据库 +create DATABASE AttDB charset utf8; +# 使用AttDB数据库 +use AttDB; +# 创建表: Student (学生表) +create table Student( + sid int primary key auto_increment, -- 主键,自动增长列 + sname varchar(20) unicode not null -- 唯一,非空 +); + +# 创建表:Attence (考勤表) +create table Attence ( + aid int primary key auto_increment, -- 主键,自动增长列 + time varchar(20) not null , -- 非空 + type int comment '1:已到;2:迟到;3旷课', + sid int , + -- 外键 + foreign key (sid) references Student(sid) +); +-- 为Student表 插入数据 + insert into student values + (null,'文杰'), + (null,'王五'), + (null,'李四'); +-- 为 Attence 表插入数据 + insert into Attence values + (null,'2023-10-1 18:11:15',1,2), + (null,'2023-3-1 18:11:15',2,1), + (null,'2023-4-1 18:11:15',1,3), + (null,'2023--7-17 18:16:32',3,1); + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/add.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/add.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..9ce02edd3bf762cb136b7b261c0e115ae6caf33d --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/add.jsp" @@ -0,0 +1,52 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%-- + Created by IntelliJ IDEA. + User: admin + Date: 2023/6/6 + Time: 16:53 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 添加页面 + + +<%--

学生考勤系统

--%> +
+

学生考勤系统

+ + + + + + + + + + + + + + + + + +
学生姓名 + +
添加时间 + +
考勤状态 + 已到: + 迟到: + 旷课: +
+ +
+
+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Arrence.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Arrence.class" new file mode 100644 index 0000000000000000000000000000000000000000..c32e46306745dc93d56d53ebce5957d5ecb84b4b Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Arrence.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Student.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Student.class" new file mode 100644 index 0000000000000000000000000000000000000000..17fcce14c8524ddb9233362a3e5e14b9c5430f38 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/bean/Student.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/AddServlet.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/AddServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..08566a77dd32721767476913912f81ef7c6ee198 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/AddServlet.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/ListServlet.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/ListServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..96165c5dbc95a06e2da97a88830c5c0c96206553 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/servlet/ListServlet.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/utils/DBUtil.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/utils/DBUtil.class" new file mode 100644 index 0000000000000000000000000000000000000000..e10672da3755fe6348249cb948e316a9cb8f8700 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/classes/utils/DBUtil.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/jstl.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/jstl.jar" new file mode 100644 index 0000000000000000000000000000000000000000..a02abecc8b888f09e4d1f9e4c9790dc482426d4f Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/jstl.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/mysql-connector-java-5.1.8.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/mysql-connector-java-5.1.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..5a7c6fb070683d0afff5aaa43ad0f8a0340ea8c3 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/mysql-connector-java-5.1.8.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/servlet-api.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/servlet-api.jar" new file mode 100644 index 0000000000000000000000000000000000000000..12ac6c27ad535bb98a3660fdc0f8fa772b939cf0 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/servlet-api.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/standard.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/standard.jar" new file mode 100644 index 0000000000000000000000000000000000000000..bc528acb949096eeb2e3048de1ff5b9ab12a66c5 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/lib/standard.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/list.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/list.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..45de0d5dfef7cc15d36cccd5313f8685a6246975 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/list.jsp" @@ -0,0 +1,39 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + +<%-- 考勤编号”、“学生编号”、“学生姓名”、“出勤时间”、“出勤状况”--%> + + + + + + + + + + + + + + + + +
考勤编号学生编号学生姓名出勤时间出勤状况
${a.aid}${a.sid}${a.sname}${a.time} + + 已到 + + + 迟到 + + + 旷课 + +
+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/msg.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/msg.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..0532c402286693f665322f3dcef1ef507de65c01 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/msg.jsp" @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2023-06-06 + Time: 18:33 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +

${msg}

+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/web.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d80081d1318531b6c30eaf0d748bf80a0b2e042a --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/WEB-INF/web.xml" @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/index.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/index.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..31b70893527c4484e53707a27d14ab60d63b9361 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/artifacts/Day0606_war_exploded/index.jsp" @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2023-06-06 + Time: 10:19 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + $END$ + + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Arrence.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Arrence.class" new file mode 100644 index 0000000000000000000000000000000000000000..c32e46306745dc93d56d53ebce5957d5ecb84b4b Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Arrence.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Student.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Student.class" new file mode 100644 index 0000000000000000000000000000000000000000..17fcce14c8524ddb9233362a3e5e14b9c5430f38 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/bean/Student.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/AddServlet.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/AddServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..08566a77dd32721767476913912f81ef7c6ee198 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/AddServlet.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/ListServlet.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/ListServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..96165c5dbc95a06e2da97a88830c5c0c96206553 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/servlet/ListServlet.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/utils/DBUtil.class" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/utils/DBUtil.class" new file mode 100644 index 0000000000000000000000000000000000000000..e10672da3755fe6348249cb948e316a9cb8f8700 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/out/production/Day0606/utils/DBUtil.class" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Arrence.java" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Arrence.java" new file mode 100644 index 0000000000000000000000000000000000000000..6205619996f364114bf2ddcef8958e4da60ab014 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Arrence.java" @@ -0,0 +1,71 @@ +package bean; + +public class Arrence { + private int aid ; // 考勤编号 + private String time; // 出勤时间 + private int type; // 出勤状况 + private int sid; // 学号 + private String sname; // 姓名 + + public Arrence() { + } + + @Override + public String toString() { + return "Arrence{" + + "aid=" + aid + + ", time='" + time + '\'' + + ", type=" + type + + ", sid=" + sid + + ", sname='" + sname + '\'' + + '}'; + } + + public int getAid() { + return aid; + } + + public void setAid(int aid) { + this.aid = aid; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getSid() { + return sid; + } + + public void setSid(int sid) { + this.sid = sid; + } + + public String getSname() { + return sname; + } + + public void setSname(String sname) { + this.sname = sname; + } + + public Arrence(int aid, String time, int type, int sid, String sname) { + this.aid = aid; + this.time = time; + this.type = type; + this.sid = sid; + this.sname = sname; + } +} diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Student.java" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Student.java" new file mode 100644 index 0000000000000000000000000000000000000000..4ebff9041ded8bffa7329b7e39e092700d863a76 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/bean/Student.java" @@ -0,0 +1,38 @@ +package bean; + +public class Student { + private int sid; // 学号 + private String sname; // 学生姓名 + + public Student() { + } + + public Student(int sid, String sname) { + this.sid = sid; + this.sname = sname; + } + + @Override + public String toString() { + return "Student{" + + "sid=" + sid + + ", sname='" + sname + '\'' + + '}'; + } + + public int getSid() { + return sid; + } + + public void setSid(int sid) { + this.sid = sid; + } + + public String getSname() { + return sname; + } + + public void setSname(String sname) { + this.sname = sname; + } +} diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/AddServlet.java" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/AddServlet.java" new file mode 100644 index 0000000000000000000000000000000000000000..6e40b6a3aa7f3ace9cd4c0a08f9681a4b277879a --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/AddServlet.java" @@ -0,0 +1,61 @@ +package servlet; + +import bean.Arrence; +import bean.Student; +import utils.DBUtil; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +@WebServlet("/add") +public class AddServlet extends HttpServlet { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { +// 查询数据库 + String sql = "select * from student" ; + ResultSet rs = DBUtil.query(sql); +// 设置一个集合 + ArrayList list = new ArrayList<>(); +// 将结果封装到集合 + try { + while(rs.next()) { + int sid = rs.getInt("sid"); + String sname = rs.getString("sname"); + Student Student = new Student( sid, sname); + list.add(Student); + } + } catch (SQLException e) { + e.printStackTrace(); + } +// 将集合添加到 request 域中 + req.setAttribute("list",list); + // 挑转到jsp表单 + req.getRequestDispatcher("/WEB-INF/add.jsp").forward(req,resp); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + req.setCharacterEncoding("utf-8"); + String sid = req.getParameter("sid"); + String time = req.getParameter("time"); + String type = req.getParameter("type"); +// 编写SQL语句 + String sql = "insert into attence values (?,?,?,?)"; + int i = DBUtil.update(sql,null,time,type,sid); + if (i>0){ + req.setAttribute("msg","添加成功"); + req.getRequestDispatcher("/WEB-INF/msg.jsp").forward(req,resp); + }else { + req.setAttribute("msg","添加失败"); + req.getRequestDispatcher("/WEB-INF/msg.jsp").forward(req,resp); + } + + } +} diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/ListServlet.java" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/ListServlet.java" new file mode 100644 index 0000000000000000000000000000000000000000..1af0a57c48a7f854bfae3c63bb60a4f267d91b37 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/servlet/ListServlet.java" @@ -0,0 +1,48 @@ +package servlet; + +import bean.Arrence; +import utils.DBUtil; + +import javax.servlet.*; +import javax.servlet.http.*; +import javax.servlet.annotation.*; +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +@WebServlet("/list") +public class ListServlet extends HttpServlet { + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { +// 查询数据库 + String sql = "select * from attence a,student s where a.sid = s.sid order by aid"; + ResultSet rs = DBUtil.query(sql); +// 设置一个集合 + ArrayList list = new ArrayList<>(); +// 将结果封装到集合 + try { + while(rs.next()) { + int aid = rs.getInt("aid"); + String time = rs.getString("time"); + int type = rs.getInt("type"); + int sid = rs.getInt("sid"); + String sname = rs.getString("sname"); + Arrence arrence = new Arrence(aid, time, type, sid, sname); + list.add(arrence); + } + } catch (SQLException e) { + e.printStackTrace(); + } +// 将集合添加到 request 域中 + request.setAttribute("list",list); +// 请求转发给一个JSP + request.getRequestDispatcher("/WEB-INF/list.jsp").forward(request,response); + + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } +} diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/utils/DBUtil.java" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/utils/DBUtil.java" new file mode 100644 index 0000000000000000000000000000000000000000..8f05495f046f801ad460216fc7a407baed8286db --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/src/utils/DBUtil.java" @@ -0,0 +1,63 @@ +package utils; + +import java.sql.*; + +public class DBUtil { +// 1. 定义数据库地址 + static String URL = "jdbc:mysql:///AttDB?characterEncoding = UTF8"; + static String USER = "root"; + static String PWD = "root"; + +// 2. 注册驱动 + static { + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } +} +// 3. 获取连接对象 + public static Connection getConn() throws SQLException { + Connection conn = DriverManager.getConnection(URL, USER, PWD); + return conn; + } +// 4.通用的查询 + public static ResultSet query(String sql,Object...keys) { +// 1. 获取连接对象 + ResultSet rs = null; + try { + Connection conn = getConn(); +// 2. 获取执行sql语句对象 + PreparedStatement pst = conn.prepareStatement(sql); +// 2.5 遍历参数 将参数赋值给?号 + for (int i = 0; i < keys.length; i++) { + pst.setObject((i+1),keys[i]); + } +// 3. 执行sql语句 + rs = pst.executeQuery(); + } catch (SQLException e) { + e.printStackTrace(); + } + return rs; + } +// 5.通用的update + public static int update(String sql,Object...keys) { +// 1. 获取连接对象 + int num = 0; + try { + Connection conn = getConn(); +// 2. 获取执行sql语句对象 + PreparedStatement pst = conn.prepareStatement(sql); +// 2.5 遍历参数 将参数赋值给?号 + for (int i = 0; i < keys.length; i++) { + pst.setObject((i+1),keys[i]); + } +// 3. 执行sql语句 + num = pst.executeUpdate(); + } catch (SQLException e) { + e.printStackTrace(); + } + return num; +} + +} diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/add.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/add.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..9ce02edd3bf762cb136b7b261c0e115ae6caf33d --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/add.jsp" @@ -0,0 +1,52 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%-- + Created by IntelliJ IDEA. + User: admin + Date: 2023/6/6 + Time: 16:53 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 添加页面 + + +<%--

学生考勤系统

--%> +
+

学生考勤系统

+ + + + + + + + + + + + + + + + + +
学生姓名 + +
添加时间 + +
考勤状态 + 已到: + 迟到: + 旷课: +
+ +
+
+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/jstl.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/jstl.jar" new file mode 100644 index 0000000000000000000000000000000000000000..a02abecc8b888f09e4d1f9e4c9790dc482426d4f Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/jstl.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/mysql-connector-java-5.1.8.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/mysql-connector-java-5.1.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..5a7c6fb070683d0afff5aaa43ad0f8a0340ea8c3 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/mysql-connector-java-5.1.8.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/servlet-api.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/servlet-api.jar" new file mode 100644 index 0000000000000000000000000000000000000000..12ac6c27ad535bb98a3660fdc0f8fa772b939cf0 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/servlet-api.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/standard.jar" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/standard.jar" new file mode 100644 index 0000000000000000000000000000000000000000..bc528acb949096eeb2e3048de1ff5b9ab12a66c5 Binary files /dev/null and "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/lib/standard.jar" differ diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/list.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/list.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..45de0d5dfef7cc15d36cccd5313f8685a6246975 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/list.jsp" @@ -0,0 +1,39 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + +<%-- 考勤编号”、“学生编号”、“学生姓名”、“出勤时间”、“出勤状况”--%> + + + + + + + + + + + + + + + + +
考勤编号学生编号学生姓名出勤时间出勤状况
${a.aid}${a.sid}${a.sname}${a.time} + + 已到 + + + 迟到 + + + 旷课 + +
+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/msg.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/msg.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..0532c402286693f665322f3dcef1ef507de65c01 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/msg.jsp" @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2023-06-06 + Time: 18:33 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +

${msg}

+ + diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/web.xml" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d80081d1318531b6c30eaf0d748bf80a0b2e042a --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/WEB-INF/web.xml" @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git "a/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/index.jsp" "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/index.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..31b70893527c4484e53707a27d14ab60d63b9361 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/Day0606 \347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/web/index.jsp" @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2023-06-06 + Time: 10:19 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + $END$ + +