环境准备
原创小于 1 分钟
SpringBoot 和 ShardingSphere 整合实现分库分表所使用的主要依赖 Jar。
依赖Jar
依赖 | 版本 |
---|---|
spring-boot-starter | 2.7.6 |
spring-boot-starter-web | 2.7.6 |
mybatis-plus-boot-starter | 3.5.3.1 |
mysql-connector-j | 8.2.0 |
shardingsphere-jdbc-core-spring-boot-starter | 5.2.0 |
pom.xml
pom.xml 文件配置
<dependencies>
<!-- springboot核心包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.7.6</version>
</dependency>
<!-- MyBatis Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.3.1</version>
</dependency>
<!-- 必须引入的包 mysql -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.2.0</version>
</dependency>
<!-- 必须引入的包 ShardingSphere -->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies>