DB数据源之SpringBoot+MyBatis踏坑过程(一) liuyuhang原创,未经允许进制转载 系列目录 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) DB数据源之SpringBoot+MyBatis踏坑过程(二)手工配置数据源与加载Mapper.xml扫描 DB数据源之SpringBoot+MyBatis踏坑过程(三)手工+半自动注解配置数据源与加载Mapper.xml扫描 DB数据源之SpringBoot+MyBatis踏坑过程(四)没有使用连接池的后果 DB…
DB数据源之SpringBoot+MyBatis踏坑过程(二)手工配置数据源与加载Mapper.xml扫描 liuyuhang原创,未经允许进制转载  吐槽之后应该有所改了,该方式可以作为一种过渡方式来使用.   系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 初次使用springboot,时间有限,需要迅速搭建好架构,没有时间研究 使用springboot过程中数据源无法获取: 使用springboot过程中注解莫名其妙失效: 用springbo…
DB数据源之SpringBoot+MyBatis踏坑过程(三)手工+半自动注解配置数据源与加载Mapper.xml扫描 liuyuhang原创,未经允许禁止转载    系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 Springboot初学者,需要学习手工配置数据源,不需要多数据源配置的情况下 建议使用本说明进行配置. springboot,parent 2.0.2.和1.5.3.都已经测试过, 在java8和java7环境下测试过.前者配java…
DB数据源之SpringBoot+MyBatis踏坑过程(四)没有使用连接池的后果 liuyuhang原创,未经允许禁止转载  系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 1.1.使用springboot手动获取数据源,其中数据源DataSource使用如下代码获取: DataSourceBuilder create = DataSourceBuilder.create(); ... DataSource source = create.bui…
DB数据源之SpringBoot+MyBatis踏坑过程(五)手动使用Hikari连接池 liuyuhang原创,未经允许禁止转载  系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 springboot2.0以上版本,java8,myeclipse2017 C1,使用的是mySql数据库 pom <parent> <groupId>org.springframework.boot</groupId> <artifac…
DB数据源之SpringBoot+MyBatis踏坑过程(七)手动使用Tomcat连接池 liuyuhang原创,未经允许禁止转载  系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 springboot2.0以下版本,java7,myeclipse2017 C1,使用的是mySql数据库 pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="ht…
DB数据源之SpringBoot+MyBatis踏坑过程(六)mysql中查看连接,配置连接数量 liuyuhang原创,未经允许禁止转载 系列目录连接 DB数据源之SpringBoot+Mybatis踏坑过程实录(一) 1.环境说明 mysql5.0以上版本. win平台cmd命令行访问 2.访问mysql数据库并查看连接状态 2.1.cmd-->进入mysql目录 说明:win64x的mysql64x版本默认安装目录会在C:\Program Files 下,32x版本会默认安装在C:\Pro…
org.springframeword.boot:spring-boot-starer-web: 2.0.4release io.shardingsphere:sharding-jdbc-spring-boot-starter:3.0.0M3 org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1 com.alibaba:druid-spring-boot-starter:1.1.9 由于项目需要,走了一波sharding jdbc多数…
报错原因如下:com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone.. 产生这个问题的原因主要在于:MySQL JDBC驱动程序的5.1.33版本与UTC时区配合使用,必须在连接字符串中明确指定serverTimezone. 当时这个问题出现于springboot2.0.0及以上版本结合mybatis2.0.0版本上,如下依赖包: 第一种:<parent> <group…
本节继续以多表连接查询的案例介绍使用resultMap的好处,对于两张以上的表进行关联查询,当我们有选择的从不同表查询所需字段时,使用resultMap是相当方便的.例如我们有两张表,分别为用户表User和文章Article,通过外键进行关联,属于一对多的关系,一个用户对应多篇文章,我们有查询语句如下: select u.username,a.title,a.content,a.posttime from article a,user u where u.uid = a.uid and u.us…