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:
[email protected]


Reply via email to