Package org.apache.synapse.commons.datasource

Examples of org.apache.synapse.commons.datasource.DataSourceRepositoryManager


     * @return Connection
     * @throws org.wso2.carbon.reporting.api.ReportingException if failed to get connection for data source
     */
    public Connection getJDBCConnection(String dataSourceName) throws ReportingException {
        Connection connection = null;
        DataSourceRepositoryManager repositoryManager;
        DataSource dataSource;

        DataSourceInformationRepositoryService repositoryService =
                ReportingComponent.getCarbonDataSourceService();
        if (repositoryService != null) {
            DataSourceInformationRepository datasourceRepo =
                    repositoryService.getDataSourceInformationRepository();
            DataSourceRepositoryHolder dataSourceHelper = DataSourceRepositoryHolder.getInstance();
            dataSourceHelper.init(datasourceRepo, null);
            repositoryManager = dataSourceHelper.getDataSourceRepositoryManager();
            if (repositoryManager != null) {
                dataSource = repositoryManager.getDataSource(dataSourceName);
                if (dataSource != null) {
                    try {
                        connection = dataSource.getConnection();
                    } catch (SQLException e) {
                        throw new ReportingException("Failed to get data source connection for "
View Full Code Here

TOP

Related Classes of org.apache.synapse.commons.datasource.DataSourceRepositoryManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.