/*
 * DatasourceConfig.java
 *
 * Copyright (C) 2017 [ A Legge Up ]
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

package com.aleggeup.confagrid.config;

import javax.sql.DataSource;

import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

@Configuration
public class DatasourceConfig {

    @Bean
    DataSource datasource(final DataSourceProperties datasourceProperties) {
        final DriverManagerDataSource dataSource = new DriverManagerDataSource();
        dataSource.setDriverClassName(datasourceProperties.getDriverClassName());
        dataSource.setUsername(datasourceProperties.getUsername());
        dataSource.setPassword(datasourceProperties.getPassword());
        dataSource.setUrl(datasourceProperties.getUrl());

        return dataSource;
    }
}

@@ -448,16 +448,71 @@
 ration;%0A
+import org.springframework.context.annotation.Primary;%0A
 import o
@@ -630,16 +630,29 @@
   @Bean%0A
+    @Primary%0A
     Data

Add 'Primary' annotation so that it is clear for AutoWired