You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/15 03:09:49 UTC

[GitHub] [shardingsphere] cielswift opened a new issue #6036: How to configure the parameters of the data source?

cielswift opened a new issue #6036:
URL: https://github.com/apache/shardingsphere/issues/6036


    shardingsphere:
       datasource:
         names: ds0,ds1 
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource  #How to configure?
           driver-class-name: com.mysql.jdbc.Driver
           url: jdbc:mysql://127.0.0.1:1670/spring_alibaba?seUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
           password: ciel
   
   Configure information such as the maximum number of connections
   
   private static void callSetterMethod(final DataSource dataSource, final String methodName, final String setterValue) {
           for (Class<?> each : GENERAL_CLASS_TYPE) {
               try {
                   Method method = dataSource.getClass().getMethod(methodName, each);
                   if (boolean.class == each || Boolean.class == each) {
                       method.invoke(dataSource, Boolean.valueOf(setterValue));
                   } else if (int.class == each || Integer.class == each) {
                       method.invoke(dataSource, Integer.parseInt(setterValue));
                   } else if (long.class == each || Long.class == each) {
                       method.invoke(dataSource, Long.parseLong(setterValue));
                   } else if (Collection.class == each) {
                       method.invoke(dataSource, Arrays.asList(setterValue.split(",")));
                   } else {
                       method.invoke(dataSource, setterValue);
                   }
                   return;
               } catch (final ReflectiveOperationException ignored) {
               }
           }
       }
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [shardingsphere] kimmking commented on issue #6036: How to configure the parameters of the data source?

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6036:
URL: https://github.com/apache/shardingsphere/issues/6036#issuecomment-643948959


   `maximumPoolSize` or `maximum-pool-size` ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [shardingsphere] cielswift closed issue #6036: How to configure the parameters of the data source?

Posted by GitBox <gi...@apache.org>.
cielswift closed issue #6036:
URL: https://github.com/apache/shardingsphere/issues/6036


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [shardingsphere] xbkaishui commented on issue #6036: How to configure the parameters of the data source?

Posted by GitBox <gi...@apache.org>.
xbkaishui commented on issue #6036:
URL: https://github.com/apache/shardingsphere/issues/6036#issuecomment-650919480


   yes for DruidDataSource the config is right. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [shardingsphere] cielswift commented on issue #6036: How to configure the parameters of the data source?

Posted by GitBox <gi...@apache.org>.
cielswift commented on issue #6036:
URL: https://github.com/apache/shardingsphere/issues/6036#issuecomment-646034104


    shardingsphere:
       datasource:
         names: ds0,ds1 #数据源名称,多数据源以逗号分隔
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource
           initial-size: 16
           min-idle: 16
           max-active: 32
           driver-class-name: com.mysql.jdbc.Driver
           url: jdbc:mysql://127.0.0.1:1670/spring_alibaba?seUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
           password: ciel
   
   this ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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