IDEA+Java+SSH+Mysql实现Web医院在线挂号系统【建议收藏】(上)

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: IDEA+Java+SSH+Mysql实现Web医院在线挂号系统【建议收藏】

一、系统介绍


1.开发环境


开发工具:IDEA2018.2


JDK版本:jdk1.8


Mysql版本:8.0.13


2.技术选型


后端:Java+Struts+Spring+Hibernate进行开发。


前端:JSP+HTML+CSS。


3.系统功能


医院挂号系统主要用于实现医院的挂号


前台基本功能包括:用户注册、用户登录、医院查询、挂号、取消挂号、修改个人信息、退出等。

后台基本功能包括:系统管理员登录、医院管理、科室管理、公告管理、退出系统等。


本系统结构如下:


1.前台功能


用户注册:注册功能;

用户登录:登录功能;

医院查询:选择医院、科室查询该医院下的医生信息

挂号:选择医生后点击挂号,填写信息完成挂号

管理中心:点击管理中心可以修改个人信息、取消挂号    


2.系统管理员


登录模块:实现管理员登录功能;

医院管理模块:实现医院的增加、删除功能;

科室管理模块:实现科室的增加、删除功能;

公告管理模块:实现公告的增加、删除功能;

退出系统模块:实现用户的退出功能;


4.数据库

/*
 Navicat Premium Data Transfer
 Source Server         : MySQL
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : 127.0.0.1:3306
 Source Schema         : ssh_hospital_registration
 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : 65001
 Date: 11/08/2021 23:31:01
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin`  (
  `userId` int(11) NOT NULL,
  `userName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `userPw` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`userId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_admin
-- ----------------------------
INSERT INTO `t_admin` VALUES (1, 'admin', 'admin');
-- ----------------------------
-- Table structure for t_gonggao
-- ----------------------------
DROP TABLE IF EXISTS `t_gonggao`;
CREATE TABLE `t_gonggao`  (
  `id` int(11) NOT NULL,
  `biaoti` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `neirong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `shijian` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_gonggao
-- ----------------------------
INSERT INTO `t_gonggao` VALUES (1, '疫情防控公告', '针对国内外疫情防控形势的新变化,为贯彻落实常态化疫情防控工作中“外防输入、内防反弹”的要求,进一步强化医院感染防控的各项措施,最大限度地降低院内感染发生风险,切实保障人民群众的健康和安全', '2021-08-11 21:20');
INSERT INTO `t_gonggao` VALUES (2, '关于感染科门诊搬迁的通知', '我院感染科门诊现已搬至3号楼2楼(该门诊候诊区有独立的自助挂号收费系统),请从西边楼梯上二楼,由此给您带来的不便,敬请谅解!', '2021-08-11 21:20');
-- ----------------------------
-- Table structure for t_guahao
-- ----------------------------
DROP TABLE IF EXISTS `t_guahao`;
CREATE TABLE `t_guahao`  (
  `id` int(11) NOT NULL DEFAULT 0,
  `zhuanjiaId` int(11) NULL DEFAULT NULL,
  `userId` int(11) NULL DEFAULT NULL,
  `riqi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `jibing` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `xingming` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `lianxi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_guahao
-- ----------------------------
INSERT INTO `t_guahao` VALUES (1, 2, 1, '2021-08-12', '1', '1', '1');
INSERT INTO `t_guahao` VALUES (2, 2, 2, '2021-08-12', '1', '1', '1');
-- ----------------------------
-- Table structure for t_keshi
-- ----------------------------
DROP TABLE IF EXISTS `t_keshi`;
CREATE TABLE `t_keshi`  (
  `keshi_id` int(11) NOT NULL,
  `keshi_anme` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`keshi_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_keshi
-- ----------------------------
INSERT INTO `t_keshi` VALUES (2, '内科', 'no');
INSERT INTO `t_keshi` VALUES (3, '外科', 'no');
INSERT INTO `t_keshi` VALUES (4, '胸科', 'no');
INSERT INTO `t_keshi` VALUES (5, '骨科', 'no');
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user`  (
  `user_id` int(11) NOT NULL,
  `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_pw` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_realname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_address` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_tel` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_del` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_user
-- ----------------------------
INSERT INTO `t_user` VALUES (1, 'liusan', '000000', '刘三', '北京路1', '13444444444', 'liusan@163.com', 'no');
INSERT INTO `t_user` VALUES (2, 'zhangsan', '000000', '张三', '湖北武汉', '123456', '123456@qq.com', 'no');
-- ----------------------------
-- Table structure for t_yiyuan
-- ----------------------------
DROP TABLE IF EXISTS `t_yiyuan`;
CREATE TABLE `t_yiyuan`  (
  `id` int(11) NOT NULL,
  `mingcheng` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `dizhi` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `dianhua` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_yiyuan
-- ----------------------------
INSERT INTO `t_yiyuan` VALUES (2, '北京大学第三医院 ', '海淀区花园北路49号', '010-82266699', 'no');
INSERT INTO `t_yiyuan` VALUES (3, '阜外心血管病医院', '西城区北礼士路167号', '010-88398866', 'no');
INSERT INTO `t_yiyuan` VALUES (4, '北京大学人民医院', '西城区西直门南大街', '010-66583666', 'no');
INSERT INTO `t_yiyuan` VALUES (5, '1', '1', '1', 'yes');
-- ----------------------------
-- Table structure for t_zhuanjia
-- ----------------------------
DROP TABLE IF EXISTS `t_zhuanjia`;
CREATE TABLE `t_zhuanjia`  (
  `id` int(11) NOT NULL DEFAULT 0,
  `yiyuanId` int(11) NULL DEFAULT NULL,
  `keshiId` int(11) NULL DEFAULT NULL,
  `xingming` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `xingbie` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `nianling` int(11) NULL DEFAULT NULL,
  `shanchang` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `leixing` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `fujian` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_zhuanjia
-- ----------------------------
INSERT INTO `t_zhuanjia` VALUES (2, 2, 2, '王晓光', '男', 40, '各类心脑血管各类疾病病', '专家门诊', '/upload/1362249942828.jpg', 'no');
INSERT INTO `t_zhuanjia` VALUES (3, 2, 2, '张大海', '男', 40, '各类心血管外科各种疾病', '专家门诊', '/upload/1362250001253.jpg', 'no');
INSERT INTO `t_zhuanjia` VALUES (4, 2, 2, '刘莉莉', '男', 52, '各类口腔科疾病药到病除', '普通门诊', '/upload/1362250044364.jpg', 'no');
SET FOREIGN_KEY_CHECKS = 1;


5.工程截图


20210815094411523.jpg


二、系统展示


1.前台-系统首页


20210815095352402.jpg


2.前台-医生查询


20210815095401400.jpg


3.前台-公告信息


20210815095409274.jpg


4.前台-用户注册


20210815095417784.jpg


5.用户-主页


20210815095429354.jpg


6.用户-修改信息


2021081509543790.jpg


7.用户-挂号信息


20210815095444770.jpg


8.管理员-登录


20210815095452402.jpg


9.管理员-主页


20210815095535593.jpg


10.管理员-修改密码


20210815095543903.jpg


11.管理员-医院信息管理


20210815095646416.jpg


12.管理员-科室信息管理


20210815095655691.jpg


13.管理员-医生信息管理


20210815095703463.jpg


14.管理员-会员信息管理


20210815095711480.jpg


15.管理员-系统公告管理


20210815095723615.jpg


三、部分代码


gonggaoAction

package com.action;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.dao.TGonggaoDAO;
import com.model.TAdmin;
import com.model.TGonggao;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class gonggaoAction extends ActionSupport {
    private Integer id;
    private String biaoti;
    private String neirong;
    private String shijian;
    private String message;
    private String path;
    private TGonggaoDAO gonggaoDAO;
    public String gonggaoAdd() {
        TGonggao gonggao = new TGonggao();
        gonggao.setBiaoti(biaoti);
        gonggao.setNeirong(neirong);
        gonggao.setShijian(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
        gonggaoDAO.save(gonggao);
        this.setMessage("公告添加完毕");
        this.setPath("gonggaoMana.action");
        return "succeed";
    }
    public String gonggaoMana() {
        List gonggaoList = gonggaoDAO.findAll();
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggaoList", gonggaoList);
        return ActionSupport.SUCCESS;
    }
    public String gonggaoDel() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        gonggaoDAO.delete(gonggao);
        this.setMessage("公告删除完毕");
        this.setPath("gonggaoMana.action");
        return "succeed";
    }
    public String gonggaoDetailHou() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggao", gonggao);
        return ActionSupport.SUCCESS;
    }
    public String gonggaoAll() {
        List gonggaoList = gonggaoDAO.findAll();
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggaoList", gonggaoList);
        return ActionSupport.SUCCESS;
    }
    public String gonggaoDetailQian() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggao", gonggao);
        return ActionSupport.SUCCESS;
    }
    public String getBiaoti() {
        return biaoti;
    }
    public void setBiaoti(String biaoti) {
        this.biaoti = biaoti;
    }
    public TGonggaoDAO getGonggaoDAO() {
        return gonggaoDAO;
    }
    public void setGonggaoDAO(TGonggaoDAO gonggaoDAO) {
        this.gonggaoDAO = gonggaoDAO;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public String getNeirong() {
        return neirong;
    }
    public void setNeirong(String neirong) {
        this.neirong = neirong;
    }
    public String getPath() {
        return path;
    }
    public void setPath(String path) {
        this.path = path;
    }
    public String getShijian() {
        return shijian;
    }
    public void setShijian(String shijian) {
        this.shijian = shijian;
    }
}

guahaoAction

package com.action;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.dao.TGuahaoDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TGuahao;
import com.model.TUser;
import com.model.TZhuanjia;
import com.opensymphony.xwork2.ActionSupport;
public class guahaoAction extends ActionSupport
{
  private Integer id;
  private Integer zhuanjiaId;
  private Integer userId;
  private String riqi;
  private String jibing;
  private String xingming;
  private String lianxi;
  private String message;
  private String path;
  private TGuahaoDAO guahaoDAO;
  private TZhuanjiaDAO zhuanjiaDAO;
  public String guahaoAdd()
  {
    HttpServletRequest request=ServletActionContext.getRequest();
    HttpSession session=request.getSession();
    TUser user=(TUser)session.getAttribute("user");
    TGuahao guahao=new TGuahao();
    guahao.setZhuanjiaId(zhuanjiaId);
    guahao.setUserId(user.getUserId());
    guahao.setRiqi(riqi);
    guahao.setJibing(jibing);
    guahao.setXingming(xingming);
    guahao.setLianxi(lianxi);
    guahaoDAO.save(guahao);
    this.setMessage("成功挂号");
    this.setPath("index.action");
    return "succeed";
  }
  public String guahaoDel()
  {   
    HttpServletRequest request=ServletActionContext.getRequest();
    TGuahao guahao=guahaoDAO.findById(id);
    guahaoDAO.delete(guahao);
    request.setAttribute("msg", "成功取消挂号");
    return "msg";
  }
  public String guahaoMana_user()
  {
    HttpServletRequest request=ServletActionContext.getRequest();
    HttpSession session=request.getSession();
    TUser user=(TUser)session.getAttribute("user");
    String sql="from TGuahao where userId="+user.getUserId();
    List guahaoList =guahaoDAO.getHibernateTemplate().find(sql);
    for(int i=0;i<guahaoList.size();i++)
    {
      TGuahao guahao=(TGuahao)guahaoList.get(i);
      guahao.setZhuanjia(zhuanjiaDAO.findById(guahao.getZhuanjiaId()));
    }
    request.setAttribute("guahaoList", guahaoList);
    return ActionSupport.SUCCESS;
  }
  public String guahaoMana_zhuanjia()
  {
    HttpServletRequest request=ServletActionContext.getRequest();
    HttpSession session=request.getSession();
    TZhuanjia zhuanjia=(TZhuanjia)session.getAttribute("zhuanjia");
    String sql="from TGuahao where zhuanjiaId="+zhuanjia.getId();
    List guahaoList =guahaoDAO.getHibernateTemplate().find(sql);
    for(int i=0;i<guahaoList.size();i++)
    {
      TGuahao guahao=(TGuahao)guahaoList.get(i);
      guahao.setZhuanjia(zhuanjiaDAO.findById(guahao.getZhuanjiaId()));
    }
    request.setAttribute("guahaoList", guahaoList);
    return ActionSupport.SUCCESS;
  }
  public TGuahaoDAO getGuahaoDAO()
  {
    return guahaoDAO;
  }
  public void setGuahaoDAO(TGuahaoDAO guahaoDAO)
  {
    this.guahaoDAO = guahaoDAO;
  }
  public TZhuanjiaDAO getZhuanjiaDAO()
  {
    return zhuanjiaDAO;
  }
  public String getMessage()
  {
    return message;
  }
  public void setMessage(String message)
  {
    this.message = message;
  }
  public String getPath()
  {
    return path;
  }
  public void setPath(String path)
  {
    this.path = path;
  }
  public void setZhuanjiaDAO(TZhuanjiaDAO zhuanjiaDAO)
  {
    this.zhuanjiaDAO = zhuanjiaDAO;
  }
  public Integer getId()
  {
    return id;
  }
  public void setId(Integer id)
  {
    this.id = id;
  }
  public String getJibing()
  {
    return jibing;
  }
  public void setJibing(String jibing)
  {
    this.jibing = jibing;
  }
  public String getLianxi()
  {
    return lianxi;
  }
  public void setLianxi(String lianxi)
  {
    this.lianxi = lianxi;
  }
  public String getRiqi()
  {
    return riqi;
  }
  public void setRiqi(String riqi)
  {
    this.riqi = riqi;
  }
  public Integer getUserId()
  {
    return userId;
  }
  public void setUserId(Integer userId)
  {
    this.userId = userId;
  }
  public String getXingming()
  {
    return xingming;
  }
  public void setXingming(String xingming)
  {
    this.xingming = xingming;
  }
  public Integer getZhuanjiaId()
  {
    return zhuanjiaId;
  }
  public void setZhuanjiaId(Integer zhuanjiaId)
  {
    this.zhuanjiaId = zhuanjiaId;
  }
}

indexAction

package com.action;
import com.opensymphony.xwork2.ActionSupport;
public class indexAction extends ActionSupport
{
  public String index()
  {
    return ActionSupport.SUCCESS;
  }
}

keshiAction

package com.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.dao.TKeshiDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TKeshi;
import com.opensymphony.xwork2.ActionSupport;
public class keshiAction extends ActionSupport
{
  private int keshiId;
  private String keshiAnme;
  private String keshiJianjie;
  private String message;
  private String path;
  private TKeshiDAO keshiDAO;
  private TZhuanjiaDAO zhuanjiaDAO;
  public String keshiAdd()
  {
    TKeshi keshi=new TKeshi();
    keshi.setKeshiAnme(keshiAnme);
    keshi.setDel("no");
    keshiDAO.save(keshi);
    this.setMessage("操作成功");
    this.setPath("keshiMana.action");
    return "succeed";
  }
  public String keshiMana()
  {
    String sql="from TKeshi where del='no'";
    List keshiList=keshiDAO.getHibernateTemplate().find(sql);
    Map request=(Map)ServletActionContext.getContext().get("request");
    request.put("keshiList", keshiList);
    return ActionSupport.SUCCESS;
  }
  public String keshiDel()
  {
    TKeshi keshi=keshiDAO.findById(keshiId);
    keshi.setDel("yes");
    keshiDAO.attachDirty(keshi);
    this.setMessage("操作成功");
    this.setPath("keshiMana.action");
    return "succeed";
  }
  public String getKeshiAnme()
  {
    return keshiAnme;
  }
  public void setKeshiAnme(String keshiAnme)
  {
    this.keshiAnme = keshiAnme;
  }
  public TKeshiDAO getKeshiDAO()
  {
    return keshiDAO;
  }
  public void setKeshiDAO(TKeshiDAO keshiDAO)
  {
    this.keshiDAO = keshiDAO;
  }
  public TZhuanjiaDAO getZhuanjiaDAO() {
    return zhuanjiaDAO;
  }
  public void setZhuanjiaDAO(TZhuanjiaDAO zhuanjiaDAO) {
    this.zhuanjiaDAO = zhuanjiaDAO;
  }
  public int getKeshiId()
  {
    return keshiId;
  }
  public void setKeshiId(int keshiId)
  {
    this.keshiId = keshiId;
  }
  public String getKeshiJianjie()
  {
    return keshiJianjie;
  }
  public void setKeshiJianjie(String keshiJianjie)
  {
    this.keshiJianjie = keshiJianjie;
  }
  public String getMessage()
  {
    return message;
  }
  public void setMessage(String message)
  {
    this.message = message;
  }
  public String getPath()
  {
    return path;
  }
  public void setPath(String path)
  {
    this.path = path;
  }
}


相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
4天前
|
存储 关系型数据库 MySQL
Java大佬必知必会——MySQL主从复制
如果你现在有两台MySQL,一台版本是03年的MySQL5.0,另一台是18年的MySQL8.0.11。新版本可以作为老版本的从服务器,但反过来是不可行的。如果二进制文件包含了已存在的数据,就会造成数据重复了。如果从服务器复制该二进制文件后的数据库状态是混乱无序的,那整个复制的过程就没有意义了。如果主、从服务器存储数据的顺序不一样,就会导致每次执行删除的数据都是不同的。,老版本可能无法解析新版本的新特性,甚至复制的文件格式都差异太大。MySQL从库只会复制它本身缺失的最新数据,利用二进制文件里的。
91 3
Java大佬必知必会——MySQL主从复制
|
1天前
|
Java 关系型数据库 MySQL
杨校老师课堂之Java项目部署到云端服务器之安装MySQL、Jdk、Tomcat
杨校老师课堂之Java项目部署到云端服务器之安装MySQL、Jdk、Tomcat
8 0
杨校老师课堂之Java项目部署到云端服务器之安装MySQL、Jdk、Tomcat
|
3天前
|
人工智能 监控 Java
|
4天前
|
缓存 监控 负载均衡
Java一分钟之-Ehcache:分布式缓存系统
【6月更文挑战第17天】**Ehcache是Java的开源缓存库,支持本地和分布式缓存,提供负载均衡、数据复制和容错能力。常见问题包括网络分区导致的数据不一致、缓存雪崩和配置不当引起的性能瓶颈。解决策略涉及选择强一致性策略、设置合理缓存过期时间和监控调整配置。使用Ehcache需添加相关依赖,并配置分布式缓存,如示例所示,通过CacheManager创建和管理缓存。实践中,持续监控和优化配置至关重要。**
22 1
|
1天前
|
Java 关系型数据库 MySQL
基于Java的高校校园点餐系统
基于Java的高校校园点餐系统
|
1天前
|
Java 关系型数据库 MySQL
基于Java的二手手机回收平台系统
基于Java的二手手机回收平台系统
|
1天前
|
Java 关系型数据库 MySQL
基于Java和SSM框架的多人命题系统
基于Java和SSM框架的多人命题系统
|
1天前
|
存储 Java 关系型数据库
基于Java的汽车在线销售系统
基于Java的汽车在线销售系统
|
1天前
|
Java 关系型数据库 MySQL
基于Java的KTV点歌系统
基于Java的KTV点歌系统
|
7天前
|
前端开发 JavaScript Java
计算机Java项目|视频网站系统
计算机Java项目|视频网站系统