# sharding-jdbc-demo **Repository Path**: luffy_ace/sharding-jdbc-demo ## Basic Information - **Project Name**: sharding-jdbc-demo - **Description**: spring boot 集成shardingsphere 5.2.1 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-06-27 - **Last Updated**: 2024-06-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sharding-jdbc-demo #### 介绍 spring boot 集成shardingsphere-jdbc(5.2.1)+mybatis-plus #### 注意事项: 1、shardingsphere-jdbc 中会有snakeyaml版本冲突,最好是exclusion自带的snakeyaml,单独引入1.33的版本 2、不能使用druid-spring-boot-starter,应为它会创建datasource,导致mapper无法注入sqlSessionFactory和sqlSessionTemplate报错,因为创建了2个datasource,导致mybatisautoconfig不知道哪个是主的数据源,无法启动 3、自定义分片规则的配置文件名称要注意,![输入图片说明](image.png) 4、如果对数据库和表名格式有要求,比如左填充,可以如此编写![输入图片说明](image.png)