// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package demo.sharding;

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;

import javax.sql.DataSource;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;

public class Config {
    public static DataSource getDataSource() throws SQLException, IOException {
        return YamlShardingSphereDataSourceFactory.createDataSource(new File("/Work/sf_mysql.yaml"));
        //return YamlShardingSphereDataSourceFactory.createDataSource(new File("/Work/sf_pgsql.yaml"));
        //return YamlShardingSphereDataSourceFactory.createDataSource(new File("/Work/sf_mssql.yaml"));
        //return YamlShardingSphereDataSourceFactory.createDataSource(new File("/Work/sf_db2.yaml"));
        //return YamlShardingSphereDataSourceFactory.createDataSource(new File("/Work/sf_ora.yaml"));
    }
}
