class DatasourceConfig {

    @Bean
    @Primary
    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;
    }

}