Overview #
DBPlusEngine-Driver provides the official Spring Boot Starter to make it convenient for developers to integrate DBPlusEngine-Driver and Spring Boot.
The list of compatible SpringBoot versions is as follows:
- SpringBoot 1.x
- SpringBoot 2.x
- SpringBoot 3.x (Experimental)
Usage #
Import Maven Dependency #
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
Use DBPlusEngine Data Source in Spring #
Developers can use DataSource to inject to use native JDBC or ORM frameworks such as JPA, Hibernate or MyBatis.
Take native JDBC usage as an example:
@Resource
private DataSource dataSource;