SpringBoot3.x 集成 shardingsphere-jdbc 实现读写分离
集成环境:
Java 21
SpringBoot 3.4.x
shardingsphere-jdbc 5.5.1
一、导入依赖
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc</artifactId>
<version>5.5.1</version>
</dependency>
二、配置数据源等
1、在 resources 目录下创建 sharding-config.yml 文件,并添加配置信息
2、在文件 sharding-config.yml 中添加配