You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/02/20 11:34:48 UTC

[GitHub] imhager commented on issue #1900: springboot2.1.1 with mybatis, druid dataSource duplicate

imhager commented on issue #1900: springboot2.1.1 with mybatis,druid dataSource duplicate
URL: https://github.com/apache/incubator-shardingsphere/issues/1900#issuecomment-465538407
 
 
   sharding.jdbc.datasource.names=ds0
   
   sharding.jdbc.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   sharding.jdbc.datasource.ds0.driver-class-name=com.mysql.jdbc.Driver
   sharding.jdbc.datasource.ds0.url=jdbc:mysql://127.0.0.1:3306/test?characterEncoding=UTF-8&serverTimezone=GMT%2B8&useUnicode=true&useSSL=false
   sharding.jdbc.datasource.ds0.username=root
   sharding.jdbc.datasource.ds0.password=123456
   
   #============== 分表 =========
   sharding.jdbc.config.sharding.tables.t_user.actual-data-nodes=ds0.t_user_$->{0..1}
   sharding.jdbc.config.sharding.tables.t_user.table-strategy.inline.sharding-column=internal_id
   sharding.jdbc.config.sharding.tables.t_user.table-strategy.inline.algorithm-expression=user_$->{internal_id.longValue() % 2}
   #未配置分片规则的表将通过默认数据源定位
   sharding.jdbc.config.sharding.default-data-source-name=ds0
   #打印sql
   sharding.jdbc.config.sharding.props.sql.show=true

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services