一零五六、Jsp+mysql 实现学生选课系统(附源码及数据库)

news2024/9/22 7:29:30

目录

实现效果

项目代码

数据库

结语



实现效果

login.jsp

index.jsp

 course_query.jsp

 course_selection.jsp

 course_withdraw.jsp

selection_query.jsp 

 

项目代码

checkSelectionStatus.jsp

%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%@ page import="java.sql.*" %>
<%

    // 查询数据库中是否已选课
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?useSSL=false&serverTimezone=UTC", "root", "123456");
        pstmt = conn.prepareStatement("SELECT status FROM selection WHERE student_id = "+session.getAttribute("student_id"));

        rs = pstmt.executeQuery();
        if (rs.next()) {
            // 如果已选课,返回1
            out.print("1");
        } else {
            // 如果未选课,返回0
            out.print("0");
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        try {
            if (rs != null) {
                rs.close();
            }
            if (pstmt != null) {
                pstmt.close();
            }
            if (conn != null) {
                conn.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
%>

</body>
</html> 

course_query.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<head>
    <title>课程查询</title>
</head>
<body>
<h1>课程查询</h1>
<table>
    <tr>
        <th>课程名称</th>
        <th>授课教师</th>
        <th>学分</th>
    </tr>
    <%
        // 查询课程信息并展示在页面上
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
            stmt = conn.createStatement();
            rs = stmt.executeQuery("SELECT name, teacher, credit FROM course");
            while (rs.next()) {
                out.println("<tr>");
                out.println("<td>" + rs.getString("name") + "</td>");
                out.println("<td>" + rs.getString("teacher") + "</td>");
                out.println("<td>" + rs.getInt("credit") + "</td>");
                out.println("</tr>");
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (rs != null) {
                try {
                    rs.close();
                } catch (Exception e) {}
            }
            if (stmt != null) {
                try {
                    stmt.close();
                } catch (Exception e) {}
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (Exception e) {}
            }
        }
    %>
</table>
<a href="index.jsp">返回主界面</a>
</body>
</html>

course_selection.jsp

<%@ page import="java.sql.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>选课操作</title>
</head>
<body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
    // 获取前端传递的student_id
    var studentId = <%= session.getAttribute("student_id") %>;

    // 发送ajax请求,查询数据库中是否已选课
    $.ajax({
        url: "checkSelectionStatus.jsp",
        type: "POST",
        data: { student_id: studentId },
        success: function(result) {
            if (result == "1") {
                // 如果已选课,显示提示信息
                var message = "您已选课,不可重复选课";
                var messageDiv = document.createElement("div");
                messageDiv.style.color = "red";
                messageDiv.innerHTML = message;
                document.body.appendChild(messageDiv);
                // 禁用输入框
                document.getElementsByName("course_id")[0].disabled = true;
            }
        }
    });
</script>
<h1>选课操作</h1>
<form action="course_selection_check.jsp" method="post">
    课程ID:
    <select name="course_id">
        <%
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try {
                Class.forName("com.mysql.jdbc.Driver");
                conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
                stmt = conn.createStatement();
                String sql = "SELECT id,name FROM course";
                rs = stmt.executeQuery(sql);
                out.println("<option value='-请选择-'>-请选择-</option>");
                while (rs.next()) {
                    int id = rs.getInt("id");
                    String name = rs.getString("name");
                    out.print("<option value='"+ id +"'>" + id +":"+ name + "</option>");
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    if (rs != null) rs.close();
                    if (stmt != null) stmt.close();
                    if (conn != null) conn.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        %>
    </select><br>
    <input type="submit" value="选课">
</form>
<a href="index.jsp">返回主界面</a>
</body>
</html>

course_selection_check.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    // 获取前端传递的course_id
    String courseId = request.getParameter("course_id");

    // 将选课信息插入数据库中
    Connection conn = null;
    PreparedStatement pstmt = null;
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?useSSL=false&serverTimezone=UTC", "root", "123456");
        pstmt = conn.prepareStatement("update selection set course_id = ?, status=1  where student_id =" + session.getAttribute("student_id"));

        pstmt.setInt(1, Integer.parseInt(courseId));
        pstmt.executeUpdate();
        out.print("选课成功");

    } catch (Exception e) {
        e.printStackTrace();
        out.print("重复选课,选课失败");
    } finally {
        try {
            if (pstmt != null) {
                pstmt.close();
            }
            if (conn != null) {
                conn.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
%>
<a href="index.jsp">返回主界面</a>
</body>
</html>

course_withdraw.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.*" %>
<html>
<head>
    <title>退课操作</title>
</head>
<body>
<h1>退课操作</h1>
<form action="course_withdraw_check.jsp" method="post">
    课程ID:
    <select name="course_id">
        <%
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try {
                Class.forName("com.mysql.jdbc.Driver");
                conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
                stmt = conn.createStatement();
                String sql = "SELECT distinct(course_id) as dis_cou FROM selection where student_id="+session.getAttribute("student_id");
                rs = stmt.executeQuery(sql);
                out.println("<option value='-请选择-'>-请选择-</option>");
                while (rs.next()) {
                    int id = rs.getInt("dis_cou");
                    out.print("<option value='"+ id +"'>" + id + "</option>");
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    if (rs != null) rs.close();
                    if (stmt != null) stmt.close();
                    if (conn != null) conn.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        %>
    </select><br>
    <input type="submit" value="选课">
</form>
<a href="index.jsp">返回主界面</a>
</body>
</html>

course_withdraw_check.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    // 将选课信息更新数据库中
    Connection conn = null;
    PreparedStatement pstmt = null;
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?useSSL=false&serverTimezone=UTC", "root", "123456");
        pstmt = conn.prepareStatement("update selection set course_id = null, status=0  where student_id =" + session.getAttribute("student_id"));
        pstmt.executeUpdate();
        out.print("退课成功");

    } catch (Exception e) {
        e.printStackTrace();
        out.print("退课失败");
    } finally {
        try {
            if (pstmt != null) {
                pstmt.close();
            }
            if (conn != null) {
                conn.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
%>
<a href="index.jsp">返回主界面</a>
</body>
</html>

index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>
<html>
<head>
    <title>学生选课系统</title>
</head>
<body>
<h1>学生选课系统</h1>

<%
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String name = "";
    Class.forName("com.mysql.cj.jdbc.Driver");
    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
    pstmt = conn.prepareStatement("SELECT name FROM student WHERE id = "+ session.getAttribute("student_id"));
    rs = pstmt.executeQuery();
    if (rs.next()) {
        name = rs.getString(1);
    }
%>


<p>
    欢迎:<font color="red"><%=name%></font>
</p>
<ul>
    <li><a href="course_query.jsp"><i class="fa fa-home fa-fw"></i>课程查询</a></li>
    <li><a href="course_selection.jsp"><i class="fa fa-bar-chart fa-fw"></i>选课操作</a></li>
    <li><a href="course_withdraw.jsp"><i class="fa fa-bar-chart fa-fw"></i>退课操作</a></li>
    <li><a href="selection_query.jsp"><i class="fa fa-bar-chart fa-fw"></i>选课结果查询</a></li>
    <li><a href="login.jsp"><i class="fa fa-sliders fa-fw"></i>登出</a></li>
</ul>

</body>
</html>

login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title>学生选课系统</title>
</head>
<body>
<h1>学生登录</h1>
<form action="login_check.jsp" method="post">
	学号:<input type="text" name="student_id"><br>
	密码:<input type="password" name="password"><br>
	<input type="submit" value="登录">
</form>
</body>
</html>

login_check.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>

<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    // 获取学生输入的学号和密码
    String student_id = request.getParameter("student_id");
    String password = request.getParameter("password");
// 查询数据库中是否存在该学生
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
        pstmt = conn.prepareStatement("SELECT * FROM student WHERE id = ? AND password = ?");
        pstmt.setInt(1, Integer.parseInt(student_id));
        pstmt.setString(2, password);
        rs = pstmt.executeQuery();
        if (rs.next()) {
            // 学生存在,将其ID存入Session,并重定向到课程查询页面
            session.setAttribute("student_id", rs.getInt("id"));
            response.sendRedirect("index.jsp");
        } else {
            // 学生不存在或密码错误,返回登录页面
            out.print("<script>alert('请确认账号密码正确后再进行登录!'); </script>");
            response.sendRedirect("login.jsp?flag=false");
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (rs != null) {
            try {
                rs.close();
            } catch (Exception e) {}
        }
        if (pstmt != null) {
            try {
                pstmt.close();
            } catch (Exception e) {}
        }
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {}
        }
    }
%>

</body>
</html>

selection_query.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<head>
    <title>选课结果查询</title>
</head>
<body>
<h1>选课结果查询</h1>
<table>
    <tr>
        <th>学生学号</th>
        <th>学生姓名</th>
        <th>授课教师</th>
        <th>课程名称</th>
        <th>学分</th>
        <th>选课状态</th>
    </tr>
    <%
        // 查询选课结果并展示在页面上
        Connection conn = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/course_selection?characterEncoding=UTF-8", "root", "123456");
            pstmt = conn.prepareStatement("SELECT * FROM selection");

            rs = pstmt.executeQuery();
            while (rs.next()) {
                int studentId = rs.getInt("student_id");
                int courseId = rs.getInt("course_id");
                int status = rs.getInt("status");

                // 查询学生姓名
                PreparedStatement pstmt1 = conn.prepareStatement("SELECT name FROM student WHERE id = ?");
                pstmt1.setInt(1, studentId);
                ResultSet rs1 = pstmt1.executeQuery();
                String studentName = "";
                if (rs1.next()) {
                    studentName = rs1.getString("name");
                }
                rs1.close();
                pstmt1.close();

                // 查询课程信息
                PreparedStatement pstmt2 = conn.prepareStatement("SELECT name, teacher, credit FROM course WHERE id = ?");
                pstmt2.setInt(1, courseId);
                ResultSet rs2 = pstmt2.executeQuery();
                String courseName = "";
                String teacherName = "";
                int credit = 0;
                if (rs2.next()) {
                    courseName = rs2.getString("name");
                    teacherName = rs2.getString("teacher");
                    credit = rs2.getInt("credit");
                }
                rs2.close();
                pstmt2.close();

                out.println("<tr>");
                out.println("<td>" + studentId + "</td>");
                out.println("<td>" + studentName + "</td>");
                out.println("<td>" + teacherName + "</td>");
                out.println("<td>" + courseName + "</td>");
                out.println("<td>" + credit + "</td>");
                out.println("<td>" + (status == 0 ? "未选课" : (status == 1 ? "已选课" : "未选课")) + "</td>");
                out.println("</tr>");
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (rs != null) {
                try {
                    rs.close();
                } catch (Exception e) {}
            }
            if (pstmt != null) {
                try {
                    pstmt.close();
                } catch (Exception e) {}
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (Exception e) {}
            }
        }
    %>
</table>
<a href="index.jsp">返回主界面</a>
</body>
</html>

数据库

/*
 Navicat Premium Data Transfer

 Source Server         : tuomasi
 Source Server Type    : MySQL
 Source Server Version : 80023
 Source Host           : localhost:3306
 Source Schema         : course_selection

 Target Server Type    : MySQL
 Target Server Version : 80023
 File Encoding         : 65001

 Date: 15/04/2023 11:30:47
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course`  (
  `id` int(0) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `teacher` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `credit` int(0) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES (1, 'Java程序设计', '张三', 4);
INSERT INTO `course` VALUES (2, 'Web开发', '李四', 3);
INSERT INTO `course` VALUES (3, '数据库原理', '王五', 3);
INSERT INTO `course` VALUES (4, '操作系统', '赵六', 4);
INSERT INTO `course` VALUES (5, '计算机网络', '钱七', 3);

-- ----------------------------
-- Table structure for selection
-- ----------------------------
DROP TABLE IF EXISTS `selection`;
CREATE TABLE `selection`  (
  `id` int(0) NOT NULL AUTO_INCREMENT,
  `student_id` int(0) NOT NULL,
  `course_id` int(0) NULL DEFAULT NULL,
  `selection_time` datetime(0) NOT NULL,
  `status` int(0) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `student_id`(`student_id`) USING BTREE,
  INDEX `course_id`(`course_id`) USING BTREE,
  CONSTRAINT `selection_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `selection_ibfk_2` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of selection
-- ----------------------------
INSERT INTO `selection` VALUES (1, 1, 1, '2021-09-01 09:30:00', 1);
INSERT INTO `selection` VALUES (2, 2, 2, '2021-09-03 11:30:00', 1);
INSERT INTO `selection` VALUES (3, 3, 3, '2021-09-05 13:30:00', 1);
INSERT INTO `selection` VALUES (4, 4, 4, '2021-09-07 15:30:00', 1);
INSERT INTO `selection` VALUES (5, 5, 5, '2021-09-09 17:30:00', 1);
INSERT INTO `selection` VALUES (6, 6, 1, '2021-09-12 20:30:00', 1);
INSERT INTO `selection` VALUES (7, 7, 2, '2021-09-14 22:30:00', 1);
INSERT INTO `selection` VALUES (8, 8, 3, '2021-09-16 00:30:00', 1);
INSERT INTO `selection` VALUES (9, 9, 4, '2021-09-18 02:30:00', 1);
INSERT INTO `selection` VALUES (10, 10, 5, '2021-09-20 04:30:00', 1);
INSERT INTO `selection` VALUES (11, 11, NULL, '2021-09-22 08:30:00', 0);
INSERT INTO `selection` VALUES (12, 12, NULL, '2021-09-24 09:30:00', 0);
INSERT INTO `selection` VALUES (13, 13, NULL, '2021-09-26 10:30:00', 0);
INSERT INTO `selection` VALUES (14, 14, NULL, '2021-09-28 12:30:00', 0);
INSERT INTO `selection` VALUES (15, 15, NULL, '2021-09-30 08:30:00', 0);
INSERT INTO `selection` VALUES (16, 16, NULL, '2021-10-02 08:50:00', 0);
INSERT INTO `selection` VALUES (17, 17, NULL, '2021-10-04 08:53:00', 0);
INSERT INTO `selection` VALUES (18, 18, NULL, '2021-10-06 08:52:00', 0);
INSERT INTO `selection` VALUES (19, 19, NULL, '2021-10-08 08:50:00', 0);
INSERT INTO `selection` VALUES (20, 20, NULL, '2021-10-10 09:50:00', 0);

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student`  (
  `id` int(0) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `age` int(0) NOT NULL,
  `contact` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES (1, '张三', '男', 19, '13812345678', '123456');
INSERT INTO `student` VALUES (2, '李四', '女', 20, '13987654321', '123456');
INSERT INTO `student` VALUES (3, '王五', '男', 21, '13612345678', '123456');
INSERT INTO `student` VALUES (4, '赵六', '女', 22, '13587654321', '123456');
INSERT INTO `student` VALUES (5, '钱七', '男', 23, '13912345678', '123456');
INSERT INTO `student` VALUES (6, '孙八', '女', 24, '13887654321', '123456');
INSERT INTO `student` VALUES (7, '周九', '男', 25, '13712345678', '123456');
INSERT INTO `student` VALUES (8, '吴十', '女', 26, '13687654321', '123456');
INSERT INTO `student` VALUES (9, '郑一', '男', 27, '13922345678', '123456');
INSERT INTO `student` VALUES (10, '王二', '女', 28, '13977654321', '123456');
INSERT INTO `student` VALUES (11, '李三', '男', 29, '13832345678', '123456');
INSERT INTO `student` VALUES (12, '张四', '女', 30, '13966654321', '123456');
INSERT INTO `student` VALUES (13, '孙五', '男', 31, '13812345698', '123456');
INSERT INTO `student` VALUES (14, '刘六', '女', 32, '13987651121', '123456');
INSERT INTO `student` VALUES (15, '陈七', '男', 33, '13612341178', '123456');
INSERT INTO `student` VALUES (16, '杨八', '女', 34, '13587653321', '123456');
INSERT INTO `student` VALUES (17, '黄九', '男', 35, '13912345628', '123456');
INSERT INTO `student` VALUES (18, '徐十', '女', 36, '13887653321', '123456');
INSERT INTO `student` VALUES (19, '吕一', '男', 37, '13922345628', '123456');
INSERT INTO `student` VALUES (20, '曾二', '女', 38, '13977655521', '123456');

SET FOREIGN_KEY_CHECKS = 1;

结语

再者,记得把jdbc驱动包加到lib目录下,启动tomcat,学生选课系统小项目就算完成了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/453254.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

图像处理:均值滤波算法

目录 前言 概念介绍 基本原理 Opencv实现中值滤波 Python手写实现均值滤波 参考文章 前言 在此之前&#xff0c;我曾在此篇中推导过图像处理&#xff1a;推导五种滤波算法&#xff08;均值、中值、高斯、双边、引导&#xff09;。这在此基础上&#xff0c;我想更深入地研…

4月23号软件更新资讯合集.....

微软发布 Web 渲染引擎 Babylon.js 6.0 Babylon.js 是一个强大、简单、开放的游戏和 Web 渲染引擎&#xff0c;并被封装在一个友好的 JavaScript 框架中。 Babylon.js 6.0 带来了性能改进、渲染增强和一系列新功能。 新物理插件 Havok 团队通过一个特殊的新 WASM 插件和对 Ba…

sar基本命令格式操作及使用方法学习笔记

目录 SAR说明Centos7安装Sar命令sar命令显示时间改为24小时制查询某天某个时间段内的数据 SAR说明 sar是一个采集&#xff0c;报告和存储计算机负载信息的工具。自下载安装好后每10分钟对系统性能进行一次采集&#xff0c;每天的日志文件保存再/var/log/sa/下&#xff0c;sa17…

Docker 部署Redis

由于项目需要&#xff0c;上了redis。公司用的是OKD4.x&#xff0c;所以在自己的环境上也直接上docker&#xff0c;比下载、编译、安装省心多了。 1、下载镜像 官网地址&#xff1a;https://hub.docker.com/_/redis 我选择的是docker pull redis:7.0-bullseye 具体版本号的含…

Web3D包装生产线 HTML5+Threejs(webgl)开发

生产线三维可视化解决方案就是通过物联网、虚实联动和三维建模等先进技术&#xff0c;以一个3D立体模型展现出来&#xff0c;可以让我们很直观的看到生产线的运作以及对数据的监控。3D运用数据孪生技术可以让工业3D物联网管理系统的界面变得非常的简单易看&#xff0c;并且能够…

软件测试的新技术和方法

作为一位资深的IT领域博主&#xff0c;我一直在关注软件测试领域的发展趋势。随着技术的不断发展&#xff0c;软件测试领域也在不断更新换代。在本文中&#xff0c;我将分享一些最新的软件测试技术和方法&#xff0c;希望能对广大软件测试工程师提供一些参考。 一、自动化测试…

【教程】保姆级红米AX6000刷UBoot和OpenWrt固件

转载请注明出处&#xff1a;小锋学长生活大爆炸[xfxuezhang.cn] 目录 开启SSH 刷入UBoot 刷入Openwrt 设置Openwrt 刷回小米原厂固件 开启SSH 1、下载官方指定版本固件&#xff1a;https://share.qust.me/redmi-ax6000-1.2.8.bin 2、进入路由器后台升级固件&#xff1a;h…

Nginx +Tomcat 负载均衡,动静分离集群

介绍 通常情况下&#xff0c;一个 Tomcat 站点由于可能出现单点故障及无法应付过多客户复杂多样的请求等情况&#xff0c;不能单独应用于生产环境下&#xff0c;所以我们需要一套更可靠的解决方案 Nginx 是一款非常优秀的http服务软件&#xff0c;它能够支持高达 50000 个并发…

IndexedDB的包装器JsStore - 分页功能

JsStore是IndexedDB的包装器。它提供了简单的SQL像api&#xff0c;这是容易学习和使用。IndexedDb查询可以在web worker内部执行&#xff0c;JsStore通过提供一个单独的worker文件来保持这种功能。 由于之前使用IndexedDB时&#xff0c;提供api不太丰富&#xff0c;就自己写了一…

Ubuntu2204安装pycharm社区版

最近在学习人工智能相关的知识&#xff0c;比较流行的开源框架对windows操作系统的支持并不太友好&#xff0c;因此把学习测试的环境搭在了Ubuntu2204上。一开始我都是在win10系统中的pycharm上写python代码&#xff0c;然后再上传到Ubuntu2204中运行测试&#xff0c;这么做降低…

GIS基础概念与开发实践

GIS的应用价值 呈现、还原、规划空间信息数据挖掘、统计分析等等 Q&#xff1a;这么多软件可以做GIS&#xff0c;但是格式又不一样&#xff0c;怎么办&#xff1f;这普需要一个标准的出现。 GIS标准&#xff1a;OGC标准 不同GIS软件对空间数据定义和存储结构不同&#xff0…

远程访问及控制ssh

SSH远程管理 OpenSSH服务器 SSH(Secure Shell) 协议 是一种安全通道协议。主要用来实现字符界面的远程登录、远程复制等功能。对通信数据进行了加密处理&#xff0c;用于远程管理其中包括用户登录时输入的用户口令。因此SSH协议具有很好的安全性------------&#xff08;同样…

C嘎嘎~~ 【初识C++ 下篇】

初识C 下篇 1.引用1.1引用的概念1.2引用的特点1.3常引用1.4引用使用的场景1.5引用和指针的区别 2.指针空值 --- nullptr3.内联函数3.1 内联函数的概念3.2内联函数的使用场景3.3内联函数的特性 1.引用 1.1引用的概念 相信大家小时候&#xff0c; 肯定有小名、绰号、亲朋好友的昵…

查询提速 20 倍,Apache Doris 在 Moka BI SaaS 服务场景下的应用实践

导读&#xff1a; MOKA 主要有两大业务线 MOKA 招聘&#xff08;智能化招聘管理系统&#xff09;和 MOKA People&#xff08;智能化人力资源管理系统&#xff09;&#xff0c;MOKA BI 通过全方位数据统计和可灵活配置的实时报表&#xff0c;赋能于智能化招聘管理系统和人力资源…

scratch甲壳虫走迷宫 中国电子学会图形化编程 少儿编程 scratch编程等级考试一级真题和答案解析2023年3月

目录 scratch甲壳虫走迷宫 一、题目要求 1、准备工作 2、功能实现 二、案例分析

ESP32学习二-环境搭建(ESP-IDF V5.0,Ubuntu18.4)

一、准备事项 Ubuntu 18.04.5。具体安装可以参考如下链接。使用VMware安装Ubuntu虚拟机和VMware Tools_t_guest的博客-CSDN博客 乐鑫官方也提供了安装的相关操作。有兴趣可以参考。 快速入门 - ESP32 - — ESP-IDF 编程指南 v5.0.1 文档 注&#xff1a;提前说明&#xff0c;因…

Android权限描述

问题 我们常常在写apk的时候申请一些相关权限。想知道每个权限的作用&#xff0c;可以查询权限声明的地方。 1、三方页面&#xff1a; https://manifestdestiny.reveb.la/ 2、源码注释 /frameworks/base/core/res/AndroidManifest.xml <!-- SystemApi TestApi Allows a…

部署 Exsi 7.0.3

文章目录 1. 下载介质2. u盘引导安装启动盘3. 硬件连接4. 安装 EXSI 7.0.3 1. 下载介质 下载 VMware-VMvisor-Installer-7.0U3l-21424296.x86_64.iso 安装 EXSI 7.0.3 可参考: https://www.dinghui.org/vmware-iso-download.html 2. u盘引导安装启动盘 工具 https://www.v…

fitlog使用教程(持续更新ing...)

诸神缄默不语-个人CSDN博文目录 fitlog包是用于自动版本管理和自动日志记录的Python包&#xff0c;是fastNLP团队开发的。 fitlog 中文文档 — fitlog 文档 他们团队的文档写的真的不行&#xff0c;崩溃&#xff0c;FastNLP也很难用&#xff0c;fitlog也很难用&#xff0c;中…

数据库系统概论--第四章课后习题

1.什么是数据库的安全性&#xff1f; 答&#xff1a; 数据库安全&#xff0c;是指以保护数据库系统、数据库服务器和数据库中的数据、应用、存储&#xff0c;以及相关网络连接为目的&#xff0c;是防止数据库系统及其数据遭到泄露、篡改或破坏的安全技术。 数据库安全与一般应…