当前位置: 首页 > news >正文

springboot整合myabtis+mysql

一、pom.xml

<!--mysql驱动包--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><!--springboot与JDBC整合包--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><!--springboot与mybatis的整合包--><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>1.3.0</version></dependency>

二、application.yml

server:port: 8081servlet:session:timeout: 10spring:servlet:multipart:max-file-size: 50MB     #单个文件最大限制max-request-size: 100MB  #多个文件最大限制# 数据源配置datasource:# 主库数据源master1:jdbcurl: jdbc:mysql://localhost/plc_xz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8username: rootpassword: root# 从库数据源master2:# 从数据源开关/默认关闭enabled: truejdbcurl: jdbc:sqlserver://localhost:1433;DatabaseName=ckywusername: apassword: athymeleaf:prefix: classpath:/templates/suffix: .htmlmode: HTML5encoding: UTF-8content-type: text/htmlcache: false
#  web:
#    resources:
#      static-locations: classpath:/static/mybatis:mapper-locations: classpath:mappers/*.xmltype-aliases-package: com.hs.entityconfiguration:#开启驼峰map-underscore-to-camel-case: truecache-enabled: truelogging:level:com:hs:dao : debugupload_url : d:/uploads/
三、启动类 SpringBootApplication.java 加 @MapperScan("com.hs.dao")注解

 注意:mapper.xm路径一般在resource下面

http://www.lryc.cn/news/100737.html

相关文章:

  • 博客摘录「 Redis( 缓存篇 ==> 超详细的缓存介绍与数据一致性解决方案 amp; 代码实现」
  • Chapter 8: Files | Python for Everybody 讲义笔记_En
  • 【C++ 进阶】第 1 章:[C 语言基础] C 语言概述与数据类型
  • 点击图片1.全屏阅览2.下载3.关闭 纯纯html css js
  • 科技项目验收测试:验证软件产品功能与性能的有效手段
  • Spring MVC学习笔记,包含mvc架构使用,过滤器、拦截器、执行流程等等
  • 【LeetCode 算法】Linked List Cycle 环形链表
  • RedHat7.9安装mysql8.0.32 ↝ 二进制方式
  • 数据库面试题题
  • 瑞吉外卖项目 基于spring Boot+mybatis-plus开发 超详细笔记,有源码链接
  • Redis Cluster 在Spring中遇到的问题
  • linux远程桌面管理工具 xrdp
  • 硬件-8-操作系统的历史
  • self.register_buffer()中的值发生变化
  • [Tools: Pycharm] Bug合集
  • 【JAVASE】循环结构
  • NoSQL之Redis配置使用
  • Ansible最佳实践之Playbook使用过滤器处理网络地址
  • 测试常见前端bug
  • 【Python数据分析】Python常用内置函数(一)
  • OpenCV图像处理-图像分割-MeanShift
  • 【Rust 基础篇】Rust Trait 实现:灵活的接口抽象
  • 【嵌入式Linux项目】基于Linux的全志H616开发板智能家居项目(语音控制、人脸识别、安卓APP和PC端QT客户端远程操控)有视频功能展示
  • ElasticSearch基础篇-条件查询与映射
  • 大模型部署框架 FastLLM 实现细节解析
  • Flutter ios真机调试连接断开后应用闪退
  • 序列化,反序列化之实例
  • 2022年全国职业院校技能大赛(高职组)“软件测试”赛项竞赛任务书
  • 第18节:R语言分析:临床安全性数据的数据分析
  • 36.悬浮板