Overview #
DBplusEngine-Driver provides a JDBC driver, and developers can configure ShardingSphereDriver
in Spring Boot to use DBplusEngine-Driver.
Usage #
Import Maven Dependency #
<dependency>
<groupId>com.sphere-ex</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${shardingsphere.version}</version>
</dependency>
Configure Spring Boot Properties #
# Configuring DataSource Drivers
spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
# Specify a YAML configuration file
spring.datasource.url=jdbc:shardingsphere:classpath:xxx.yaml
Use Data Source #
Use this data source directly; or configure ShardingSphereDataSource to be used in conjunction with ORM frameworks such as JPA, Hibernate, and MyBatis.