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 2019/09/03 13:57:19 UTC

[GitHub] [incubator-shardingsphere] cherrylzhao commented on a change in pull request #2951: fix issue 2902: Fix bugs in support for spring declarative transactions

cherrylzhao commented on a change in pull request #2951: fix issue 2902: Fix bugs in support for spring declarative transactions
URL: https://github.com/apache/incubator-shardingsphere/pull/2951#discussion_r320286389
 
 

 ##########
 File path: sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/yaml/YamlShardingDataSourceFactory.java
 ##########
 @@ -51,6 +51,27 @@ public static DataSource createDataSource(final File yamlFile) throws SQLExcepti
         return ShardingDataSourceFactory.createDataSource(config.getDataSources(), new ShardingRuleConfigurationYamlSwapper().swap(config.getShardingRule()), config.getProps());
     }
     
+    /**
+     * Create sharding data source.
+     *
+     * @param yamlFile YAML file for rule configuration of databases and tables sharding with data sources
+     * @param configClass target class that the YAML configuration needs to be converted
+     * @return sharding data source
+     * @throws SQLException SQL exception
+     * @throws IOException IO exception
+     */
+    public static DataSource createDataSource(final File yamlFile, Class<? extends YamlRootShardingConfiguration> configClass) throws SQLException, IOException {
 
 Review comment:
   I think this is only for your example code use, in fact yaml is only one of our configuration, we should not change the api easily.

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


With regards,
Apache Git Services