首页 > 试题

springboot+mycat数据库中间件+mysql(一主一备)主从复制

更新时间:2024-12-23 20:52:51 阅读: 评论:0

2023年12月27日发(作者:防诈骗黑板报)

spring:

datasource:

url: jdbc:mysql://192.168.43.155:8066/mydb

urname: mycat

password: mycat

driverClassName: controller

package ller;import ;import red;import ller;import ap;import tMapping;import ndView;import ;import Service;@Controllerpublic class TicketController { @Autowired private TicketService ticketService; @RequestMapping("/") public ModelAndView getTicketList() { List ticketList = ketList(); ModelAndView mav = new ModelAndView(); wName("index"); ect("ticketList", ticketList); return mav; }; @RequestMapping("/") public ModelAndView getFtl(ModelAndView mav) { ect("name", "ss"); wName("index"); return mav; }; @RequestMapping("/index") public String getFtlt(ModelMap map) { ribute("name", "你妈"); return "index"; };}

rvice

package e;import ;import red;import e;import Mapper;import ;import ils;@Servicepublic class TicketService { @Autowired private TicketMapper ticketMapper; public List getTicketList() { List ticketList = ketList(); for (Ticket ticket : ticketList) { String beginTimeStr = Time(inTime()); String endTimeStr = Time(Time()); inTimeStr(beginTimeStr); TimeStr(endTimeStr); } return ticketList; }}

mapper

package ;import ;import ;import ;public interface TicketMapper {

@Select("lect * from ticket;") List getTicketList();}ticket

package ;import ;/** *

* @ClassName: Ticket

} public void tPrice(Integer price) { = price; } public Date getBeginTime() { return beginTime; } public void tBeginTime(Date beginTime) { ime = beginTime; } public Date getEndTime() { return endTime; } public void tEndTime(Date endTime) { e = endTime; } public String getBeginTimeStr() { return beginTimeStr; } public void tBeginTimeStr(String beginTimeStr) { imeStr = beginTimeStr; } public String getEndTimeStr() { return endTimeStr; } public void tEndTimeStr(String endTimeStr) { eStr = endTimeStr; }

}(模板引擎)

本文发布于:2023-12-27 21:28:56,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/zhishi/a/88/44824.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:springboot+mycat数据库中间件+mysql(一主一备)主从复制.doc

本文 PDF 下载地址:springboot+mycat数据库中间件+mysql(一主一备)主从复制.pdf

标签:黑板报   数据库   模板
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 实用文体写作网旗下知识大全大全栏目是一个全百科类宝库! 优秀范文|法律文书|专利查询|