Background

ShardingSphere-Proxy supports common data source connection pools: HikariCP, C3P0, DBCP (C3P0, DBCP need download plugin from shardingsphere-plugins repository).

The connection pool can be specified through the parameter dataSourceClassName. When not specified, the default data source connection pool is HikariCP.

Parameters

  1. dataSources: # Data sources configuration, multiple <data-source-name> available
  2. <data_source_name>: # Data source name
  3. dataSourceClassName: # Data source connection pool full class name
  4. url: # The database URL connection
  5. username: # Database username
  6. password: # The database password
  7. # ... Other properties of data source pool

Sample

  1. dataSources:
  2. ds_1:
  3. url: jdbc:mysql://localhost:3306/ds_1
  4. username: root
  5. password:
  6. ds_2:
  7. dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource
  8. url: jdbc:mysql://localhost:3306/ds_2
  9. username: root
  10. password:
  11. ds_3:
  12. dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
  13. url: jdbc:mysql://localhost:3306/ds_3
  14. username: root
  15. password:
  16. # Configure other data sources