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 2021/05/29 08:33:35 UTC

[GitHub] [shardingsphere] zjcnb commented on issue #10543: [Examples] shardingsphere-jdbc-example test report issue

zjcnb commented on issue #10543:
URL: https://github.com/apache/shardingsphere/issues/10543#issuecomment-850795803


   My database password is a number and the YAML configuration is automatically converted to INTEGER when loaded. But to set the password, the required parameter type is String
   
   `   public DataSource createDataSource() {
           DataSource result = (DataSource) Class.forName(dataSourceClassName).getConstructor().newInstance();
           Method[] methods = result.getClass().getMethods();
           for (Entry<String, Object> entry : props.entrySet()) {
               if (SKIPPED_PROPERTY_NAMES.contains(entry.getKey())) {
                   continue;
               }
               try {
                   Optional<Method> setterMethod = findSetterMethod(methods, entry.getKey());
                   if (setterMethod.isPresent()) {
                       setterMethod.get().invoke(result, entry.getValue());
                   }
               } catch (final IllegalArgumentException ex) {
                   throw new ShardingSphereConfigurationException("Incorrect configuration item: the property %s of the dataSource, because %s", entry.getKey(), ex.getMessage());
               }
           }
           Optional<JDBCParameterDecorator> decorator = findJDBCParameterDecorator(result);
           return decorator.isPresent() ? decorator.get().decorate(result) : result;
       } `
   


-- 
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