Spring Boot Starter Configuration

Introduction

ShardingSphere-JDBC provides official Spring Boot Starter to make convenient for developers to integrate ShardingSphere-JDBC and Spring Boot.

Data Source Configuration

  1. spring.shardingsphere.schema.name= # JDBC data source alias, this parameter is optional. If it is not configured, logic_db is used as the schemaName by default.
  2. spring.shardingsphere.datasource.names= # Data source name, multiple data sources are separated by commas
  3. spring.shardingsphere.datasource.<datasource-name>.type= # Database connection pool type name
  4. spring.shardingsphere.datasource.<datasource-name>.driver-class-name= # Database driver class name
  5. spring.shardingsphere.datasource.<datasource-name>.jdbc-url= # Database URL connection
  6. spring.shardingsphere.datasource.<datasource-name>.username= # Database username
  7. spring.shardingsphere.datasource.<datasource-name>.password= # Database password
  8. spring.shardingsphere.datasource.<datasource-name>.xxx= # Other properties of database connection pool

Rule Configuration

  1. spring.shardingsphere.rules.<rule-type>.xxx= # rule configurations
  2. # ... Specific rule configurations

Please refer to specific rule configuration for more details.

Properties Configuration

  1. spring.shardingsphere.props.xxx.xxx= # Properties key and value

Please refer to Properties Configuration for more details about type of algorithm.