JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql关注公众号:吾爱代码,回复Java学生管理系统,获取下载链接~关注公众号:吾爱代码,回复Java学生管理系统,获取下载链接~关注公众号:吾爱代码,回复Java学生管理系统,获取下载链接~

大家好,又见面了,我是你们的朋友全栈君。

关注公众号:吾爱代码,回复Java学生管理系统,获取下载链接~

关注公众号:吾爱代码,回复Java学生管理系统,获取下载链接~

代码免费!!!代码免费!!!代码免费!!!

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

运行截图:

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

 

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

项目文件结构:

JavaWeb-简单学生信息管理系统的实现-Jsp+Servlet+MySql

获取 数据库连接类:

package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @ClassName: DbConnect
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/27 21:36
 */
public class DbConnect {
    public static Connection connection;
    public static String url = "jdbc:mysql://localhost/stumanage?user=root&password=root"
            + "&useUnicode=true&characterEncoding=utf-8&useSSL=true";

    public static Connection getConnection() {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            connection = DriverManager.getConnection(url);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return connection;
    }
}

对应学生的实体类:

package entity;


public class Student {

    private long id;
    private String name;
    private String sex;
    private String specialty;
    private String grade;

    public Student() {
    }

    public Student(long id, String name, String sex, String specialty, String grade) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.specialty = specialty;
        this.grade = grade;
    }

    public Student(String name, String sex, String specialty, String grade) {
        this.name = name;
        this.sex = sex;
        this.specialty = specialty;
        this.grade = grade;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }


    public String getSpecialty() {
        return specialty;
    }

    public void setSpecialty(String specialty) {
        this.specialty = specialty;
    }


    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

}

登录界面jsp:

<%--
  Created by IntelliJ IDEA.
  User: 24234
  Date: 2019/3/27
  Time: 19:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>学生管理系统</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
</head>
<body>
<center>
    <form action="/loginServer" method="post">
        <table>
            <tr>
                <td>
                    用户名
                </td>
                <td>
                    <input type="text" name="admin">
                </td>
            </tr>
            <tr>
                <td>
                    密&nbsp&nbsp码
                </td>
                <td>
                    <input type="password" name="pwd">
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="登录">
                </td>
            </tr>

        </table>
    </form>
</center>
</body>
</html>

登录servlet:(查询所有学生信息显示到主页面jsp)

package servlet;

import db.DbConnect;

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 javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @ClassName: ${NAME}
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/28 20:29
 */
@WebServlet(name = "loginServer")
public class loginServer extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html");
        req.setCharacterEncoding("utf-8");
        resp.setCharacterEncoding("utf-8");
        String admin = req.getParameter("admin");
        String pwd = req.getParameter("pwd");
        if (admin.equals("admin") && pwd.equals("123")) {
            Connection connection = DbConnect.getConnection();
            String sql = "SELECT * FROM STUDENT";
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
            try {
                preparedStatement = connection.prepareStatement(sql);
                resultSet = preparedStatement.executeQuery();
                HttpSession httpSession = req.getSession();
//                设置session有效时间为两小时
                httpSession.setMaxInactiveInterval(7200);
                httpSession.setAttribute("resultSet", resultSet);
                resp.sendRedirect("loginAction.jsp");
            } catch (SQLException e) {
                e.printStackTrace();
            }
        } else {
            resp.sendRedirect("index.jsp");
        }

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}

主页面jsp:

<%@ page import="java.sql.ResultSet" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/28
  Time: 14:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<% ResultSet resultSet = (ResultSet) session.getAttribute("resultSet");%>
<html>
<head>
    <title>学生管理系统</title>
    <link rel="stylesheet" type="text/css" href="css/table.css">
</head>
<body>
<center>
    <table class="gridtable">
        <tr>
            <td align="center" colspan="6">学生信息</td>
        </tr>
        <tr>
            <td>姓名</td>
            <td>性别</td>
            <td>专业</td>
            <td>年级</td>
            <td align="center" colspan="2">操作</td>
        </tr>
        <%
            while (resultSet.next()) {
        %>

        <tr>
            <td><%=resultSet.getString("name")%>
            </td>
            <td><%=resultSet.getString("sex")%>
            </td>
            <td><%=resultSet.getString("specialty")%>
            </td>
            <td><%=resultSet.getString("grade")%>
            </td>
            <td><a href="selectServlet?id=<%=resultSet.getInt("id")%>">修改</a></td>
            <td><a href="deleteServlet?id=<%=resultSet.getInt("id")%>" onclick="return confirm('确定删除?')">删除</a></td>
        </tr>
        <%}%>
        <tr>
            <td align="center" colspan="6">
                <a href="stuAdd.jsp">添加</a>
            </td>
        </tr>
    </table>
</center>
</body>
</html>

根据id查询数据库记录:

package servlet;

import db.DbConnect;
import entity.Student;

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 javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @ClassName: ${NAME}
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/29 15:20
 */
@WebServlet(name = "selectServlet")
public class selectServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("utf-8");
        request.setCharacterEncoding("utf-8");
        String id = request.getParameter("id");
        String sql = "SELECT * FROM STUDENT WHERE ID=?";
        Connection connection = DbConnect.getConnection();
        PreparedStatement preparedStatement = null;
        ResultSet resultset = null;
        Student student = null;
        try {
            preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setInt(1, Integer.parseInt(id));
            resultset = preparedStatement.executeQuery();
            while (resultset.next()) {
                String name = resultset.getString("name");
                String sex = resultset.getString("sex");
                String specialty = resultset.getString("specialty");
                String grade = resultset.getString("grade");
                student = new Student(Integer.parseInt(id), name, sex, specialty, grade);
            }
            HttpSession httpSession = request.getSession();
            httpSession.setAttribute("student", student);
            response.sendRedirect("stuEdit.jsp");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}

 修改学生信息jsp:

<%@ page import="entity.Student" %><%--
  Created by IntelliJ IDEA.
  User: 24234
  Date: 2019/3/29
  Time: 14:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>修改学生信息</title>
    <link rel="stylesheet" type="text/css" href="css/table.css">
</head>
<body>
<%Student student = (Student) session.getAttribute("student");%>
<form action="/updateServlet" method="post">
    <center>
        <table class="gridtable">
            <tr>
                <td align="center" colspan="2">
                    修改学生信息
                    <input type="hidden" name="id" value="<%=student.getId()%>">
                </td>
            </tr>
            <tr>
                <td>姓名</td>
                <td><input type="text" name="name" value="<%=student.getName()%>"></td>
            </tr>
            <tr>
                <td>性别</td>
                <td><%if (student.getSex().equals("男")) {%>
                    <input type="radio" name="sex" value="男" checked="checked">男
                    <input type="radio" name="sex" value="女">女
                </td>
                <%
                } else {
                %>
                <td>
                    <input type="radio" name="sex" value="男">男
                    <input type="radio" name="sex" value="女" checked="checked">女
                </td>
                <%}%>
            </tr>
            <tr>
                <td>专业</td>
                <td><input type="text" name="specialty" value="<%=student.getSpecialty()%>"></td>
            </tr>
            <tr>
                <td>年级</td>
                <td>
                    <%
                        if (student.getGrade().equals("大一")) {
                    %>
                    <select name="grade">
                        <option value="大一" selected="selected">大一</option>
                        <option value="大二">大二</option>
                        <option value="大三">大三</option>
                        <option value="大四">大四</option>
                    </select>
                    <%} else if (student.getGrade().equals("大二")) {%>
                    <select name="grade">
                        <option value="大一">大一</option>
                        <option value="大二" selected="selected">大二</option>
                        <option value="大三">大三</option>
                        <option value="大四">大四</option>
                    </select>
                    <%} else if (student.getGrade().equals("大三")) {%>
                    <select name="grade">
                        <option value="大一">大一</option>
                        <option value="大二">大二</option>
                        <option value="大三" selected="selected">大三</option>
                        <option value="大四">大四</option>
                    </select>
                    <%} else if (student.getGrade().equals("大四")) {%>
                    <select name="grade">
                        <option value="大一">大一</option>
                        <option value="大二">大二</option>
                        <option value="大三">大三</option>
                        <option value="大四" selected="selected">大四</option>
                    </select>
                    <%}%>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <input type="submit" value="修改">
                </td>
            </tr>
        </table>
    </center>
</form>
</body>
</html>

修改学生信息servlet:

package servlet;

import db.DbConnect;

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 javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @ClassName: ${NAME}
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/29 15:44
 */
@WebServlet(name = "updateServlet")
public class updateServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("utf-8");
        request.setCharacterEncoding("utf-8");
        String id = request.getParameter("id");
        String name = request.getParameter("name");
        String sex = request.getParameter("sex");
        String specialty = request.getParameter("specialty");
        String grade = request.getParameter("grade");
        Connection connection = DbConnect.getConnection();
        String sql = "UPDATE STUDENT SET name=? , sex=? , specialty=? , grade=? where id=?";
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;
        try {
            preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setInt(5, Integer.parseInt(id));
            preparedStatement.setString(1, name);
            preparedStatement.setString(2, sex);
            preparedStatement.setString(3, specialty);
            preparedStatement.setString(4, grade);
            int i = preparedStatement.executeUpdate();
            HttpSession httpSession = request.getSession();
            if (i == 1) {
                String selectAll = "SELECT * FROM STUDENT";
                preparedStatement = connection.prepareStatement(selectAll);
                resultSet = preparedStatement.executeQuery();
                httpSession.setMaxInactiveInterval(7200);
                httpSession.setAttribute("resultSet", resultSet);
                response.sendRedirect("loginAction.jsp");
            } else {
                httpSession.setAttribute("message", "修改失败!");
                response.sendRedirect("error.jsp");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}

添加学生信息jsp:

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/28
  Time: 14:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>添加学生信息</title>
    <link rel="stylesheet" type="text/css" href="css/table.css">
</head>
<body>
<form action="/addServlet" method="post">
    <center>
        <table class="gridtable">
            <tr>
                <td align="center" colspan="2">添加学生信息</td>
            </tr>
            <tr>
                <td>姓名</td>
                <td><input type="text" name="name"></td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <input type="radio" name="sex" value="男" checked="checked">男
                    <input type="radio" name="sex" value="女">女
                </td>
            </tr>
            <tr>
                <td>专业</td>
                <td><input type="text" name="specialty"></td>
            </tr>
            <tr>
                <td>年级</td>
                <td><select name="grade">
                    <option value="大一">大一</option>
                    <option value="大二">大二</option>
                    <option value="大三">大三</option>
                    <option value="大四">大四</option>
                </select></td>
            </tr>
            <tr>
                <td align="center" colspan="2"><input type="submit" value="添加"></td>
            </tr>
        </table>
    </center>
</form>
</body>
</html>

添加学生信息servlet:

package servlet;

import db.DbConnect;
import entity.Student;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @ClassName: ${NAME}
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/28 20:24
 */
public class addServlet extends javax.servlet.http.HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        String name = request.getParameter("name");
        String sex = request.getParameter("sex");
        String specialty = request.getParameter("specialty");
        String grade = request.getParameter("grade");
        Student student = new Student(name, sex, specialty, grade);
        Connection connection = DbConnect.getConnection();
        String sql = "INSERT INTO student(name,sex,specialty,grade) values(?,?,?,?)";
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;
        try {
            preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setString(1, student.getName());
            preparedStatement.setString(2, student.getSex());
            preparedStatement.setString(3, student.getSpecialty());
            preparedStatement.setString(4, student.getGrade());
            int i = preparedStatement.executeUpdate();
            HttpSession httpSession = request.getSession();
            if (i == 1) {
                String selectSql = "SELECT * FROM STUDENT";
                preparedStatement = connection.prepareStatement(selectSql);
                resultSet = preparedStatement.executeQuery();
                httpSession.setMaxInactiveInterval(7200);
                httpSession.setAttribute("resultSet", resultSet);
                response.sendRedirect("loginAction.jsp");
            } else {
                httpSession.setAttribute("message", "添加失败!");
                response.sendRedirect("error.jsp");
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}

删除学生信息servlet:

package servlet;

import db.DbConnect;

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 javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @ClassName: ${NAME}
 * @Author: Leo
 * @Description:
 * @Date: 2019/3/29 16:05
 */
@WebServlet(name = "deleteServlet")
public class deleteServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("utf-8");
        request.setCharacterEncoding("utf-8");
        String id = request.getParameter("id");
        String sql = "DELETE FROM STUDENT WHERE ID=?";
        Connection connection = DbConnect.getConnection();
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;
        HttpSession httpSession = request.getSession();
        try {
            preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setInt(1, Integer.parseInt(id));
            int i = preparedStatement.executeUpdate();
            if (i == 1) {
                String select = "SELECT * FROM STUDENT";
                preparedStatement = connection.prepareStatement(select);
                resultSet = preparedStatement.executeQuery();
                httpSession.setMaxInactiveInterval(7200);
                httpSession.setAttribute("resultSet", resultSet);
                response.sendRedirect("loginAction.jsp");
            } else {
                httpSession.setAttribute("message", "删除失败!");
                response.sendRedirect("error.jsp");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}

错误页面:

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/28
  Time: 15:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>Error</title>
</head>
<body>
<%
    String message = (String) session.getAttribute("message");
    out.print(message);
%>
</body>
</html>

web.xml

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
    <display-name>Archetype Created Web Application</display-name>
    <servlet>
        <servlet-name>addServlet</servlet-name>
        <servlet-class>servlet.addServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>loginServer</servlet-name>
        <servlet-class>servlet.loginServer</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>selectServlet</servlet-name>
        <servlet-class>servlet.selectServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>updateServlet</servlet-name>
        <servlet-class>servlet.updateServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>deleteServlet</servlet-name>
        <servlet-class>servlet.deleteServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>addServlet</servlet-name>
        <url-pattern>/addServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>loginServer</servlet-name>
        <url-pattern>/loginServer</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>selectServlet</servlet-name>
        <url-pattern>/selectServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>updateServlet</servlet-name>
        <url-pattern>/updateServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>deleteServlet</servlet-name>
        <url-pattern>/deleteServlet</url-pattern>
    </servlet-mapping>

</web-app>

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/131958.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 关于Virt-P2V那点事

    关于Virt-P2V那点事在实现企业服务器虚拟化的时候,许多系统已经是NT或Windows 2000的老系统,要安装上虚拟机还得重装系统,但是已经找不到光盘或是驱动程序了,因此重装系统是无法成功的,要将旧服务器虚拟化,最好的办法就是实体机转换(P2V)。一、什么是P2V?P2V是Physical to virtual的简称,即物理到虚拟。它是指将物理机上的系统、应用软件以及数据转换到虚拟机中。它的工作原理是将物

    2022年7月26日
    7
  • Oracle sql调优(网络优化知识点)

    文章目录一、访问数据的方法1、直接访问数据1.1全表扫描1.2ROWID扫描2、访问索引2.1索引唯一扫描2.2索引范围扫描2.3索引全扫描2.4索引快速全扫描2.5索引跳跃式扫描拓展补充本博客介绍一下属于oracle优化器范畴的一些基础知识,访问数据的方法,分为直接访问数据的方法和访问索引的方法两种,然后有了这些基础知识后,可以参考学习我的另外一篇博客:Oracle优化器简介,对…

    2022年4月13日
    42
  • Oracle报错:不是单组分组函数解决「建议收藏」

    Oracle报错:不是单组分组函数解决「建议收藏」Oracle报错:不是单组分组函数解决报错:不是单组分组函数实例:selectdeptno,count(empno)fromemp;报错:不是单组分组函数原因:1,如果程序中使用了分组函数,则有两种情况可以使用:程序中存在groupby,并指定了分组条件,这样可以将分组条件一起查询出来改为:selectdeptno,count(empno)fromempgrou…

    2022年6月29日
    195
  • 系统分析师零散知识点「建议收藏」

    系统分析师零散知识点「建议收藏」数据库连接池技术是指在系统初期或者初次使用时,完成数据库的连接,以后不再释放此连接,在处理后面的请求时,反复使用这些已经建立的连接。这种方式可以大大减少数据库的处理时间,有利于提高系统的整体性能、可测量性和扩展性。应用服务器的高速缓存?在应用服务器中有页面的缓存和数据库的缓存。页面的缓存是指将特定的URL对应的页面在缓存中予以记录,以便在

    2022年5月24日
    84
  • django url标签_正确的url格式

    django url标签_正确的url格式前言当我们访问网页的时候,后台返回列表中有n条数据,此时我们会使用分页,比如一页只展示10条,但是我们访问第一页的时候大多数情况下,都会给url一个默认值,访问的时候直接展示第一页数据案例我们的

    2022年7月28日
    6
  • 莫比乌斯反演的两种形式及其证明

    莫比乌斯反演的两种形式及其证明莫比乌斯反演形式一 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 证明 把代入右边的式子 得 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 根据莫比乌斯函数的性质 有定理 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 因此 只有

    2025年6月28日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号