springboot项目整合mybatis,配置文件如下:

server:
port: 8081
mybatis:
config-location: classpath:mybatis/mybatis-config.xml #mybatis配置文件所在路径
type-aliases-package: com.yuanqiao.entities #所有entity别名类所在包
mapper-locations: classpath:mybatis/mapper/*.xml
spring:
application:
name: swaggerdemo
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
password: 123456
dbcp2:
min-idle: 5 #数据库连接池的最小维持连接数
initial-size: 5 #初始化连接数
max-total: 5 #最大连接数
max-wait-millis: 200 #等待连接获取的最大超时时间

做sql查询的时候,提示com.mysql.jdbc.Driver已经弃用了。

Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5540e55e] was not registered for synchronization because synchronization is not active
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2019-07-20 16:16:42.533 INFO 59084 --- [nio-8081-exec-2] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@366b8e6b] will not be managed by Spring
==> Preparing: select * from user where id = ?
==> Parameters: 1(Integer)
<== Columns: id, name, sex, age
<== Row: 1, zhangsan, male, 22
<== Total: 1
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5540e55e]

最新文章

  1. google api autocomplete
  2. [c#]params可变参数
  3. Linux基础命令总结
  4. Xamarin环境搭建
  5. Android Layout_Gravity和Gravity
  6. input placeholder文字垂直居中(Mobile &amp; PC)
  7. [LeetCode]Rotate Image(矩阵旋转)
  8. pythonic-让python代码更高效
  9. python文件名和文件路径操作
  10. Laravel 系列入门教程(二)【最适合中国人的 Laravel 教程】
  11. vue单页应用添加百度统计
  12. [Hive_11] Hive 的高级聚合函数
  13. HTML常用标签定义,用法及例子
  14. SQL Server中使用数据库快照的方式来完成测试环境中数据库的轻量级备份还原操作
  15. 看懂「www.google.com」背后的逻辑
  16. vlookup函数应用
  17. LeetCode: Largest Number 解题报告 以及Comparator, CompareTo 应用
  18. SQL语句提取某列中的HTML文本内容。或者说怎么用SQL语句去除所有HTML标签
  19. Asp.Net 启用全局IE兼容模式
  20. webstorm2017添加vue模板

热门文章

  1. 【贪心】Allowance POJ 3040
  2. Dobbox
  3. 双向认证下rpc-gateway使用(同时提供rpc和http服务)
  4. Linux 命令-egrep
  5. CF19D Points 平衡树
  6. 【一起来烧脑】读懂Promise知识体系
  7. Windows下Apache配置多域名项目
  8. 【知识点】同样是消息队列,Kafka凭什么速度那么快?
  9. 标准ACL详解
  10. 文献阅读 | Epigenetics in ENS development and Hirschsprung disease