# Springboot-Druid-Sharding-jdbc5.0.0-Mybatis **Repository Path**: samples-andy/springboot-druid-sharding-jdbc5.0.0-mybatis ## Basic Information - **Project Name**: Springboot-Druid-Sharding-jdbc5.0.0-Mybatis - **Description**: 忘记哪里下载的demo了,升级了shardingsphere版本,修改了配置 Springboot 2.4.5 shardingsphere5.0.0 druid1.2.8 mybatis-plus 3.5.0 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 3 - **Created**: 2022-01-25 - **Last Updated**: 2024-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springboot-sharding-jdbc-demo1 #### 介绍 忘记哪里下载的demo了,升级了shardingsphere版本,修改了配置 Springboot 2.4.5 shardingsphere5.0.0 druid1.2.8 mybatis-plus 3.5.0 基于springboot2.0,sharding-jdbc, mysql5.7, 实现分库分表操作。 #### 软件架构 软件架构说明 Springboot、druid、mybatis-plus、sharding-jdbc5.0.0 分库分表整合示例 Springboot 2.4.5 https://spring.io/projects/spring-boot org.springframework.boot spring-boot-starter 分库分表中间件 shardingsphere5.0.0 shardingsphere 老版本的配置是有区别的,具体看对应版本的文档 5.0.0 org.apache.shardingsphere shardingsphere-jdbc-core-spring-boot-starter ${shardingsphere.version} 数据库连接池 druid1.2.8 1.2.8 com.alibaba druid ${druid.version} demo1: # 配置第 1 个数据源 type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/sharding-demo1 username: root password: root 不同的数据库连接池,配置不同,需要注意,比如 hikari tmall: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://127.0.0.1:3306/tmall?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 username: root password: 123456 数据库操作中间件 mybatis-plus 3.5.0 https://baomidou.com/ 3.5.0 com.baomidou mybatis-plus-boot-starter ${mybatis-plus.version} mybatis-plus: mapper-locations: classpath:mapping/*.xml type-aliases-package: com.kinglong.demo.model,com.kinglong.demo.model.vo configuration: map-underscore-to-camel-case: true mybatis 2.1.2 (mybatis 和 mybatis-plus 二选一) 2.1.2 org.mybatis.spring.boot mybatis-spring-boot-starter ${mybatis.version} mybatis: mapperLocations: classpath:mapping/*.xml type-aliases-package: com.kinglong.demo.model,com.kinglong.demo.model.vo