ShardingSphere-JDBC

    1. Rules configuration.
    1. Import Maven dependency
    1. Edit application.yml.
    1. spring:
    2. names: ds_0, ds_1
    3. ds_0:
    4. type: com.zaxxer.hikari.HikariDataSource
    5. driverClassName: com.mysql.cj.jdbc.Driver
    6. jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
    7. username: root
    8. password:
    9. type: com.zaxxer.hikari.HikariDataSource
    10. driverClassName: com.mysql.cj.jdbc.Driver
    11. jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
    12. username: root
    13. password:
    14. rules:
    15. sharding: