package ru.nbch.credit_tracker.config.datasource;

import org.springframework.boot.jdbc.DataSourceBuilder;
import ru.nbch.credit_tracker.config.settings.DataSourceSettings;

import javax.sql.DataSource;

public class DatabaseConfig {

    protected DataSource createDataSource(DataSourceSettings settings) {
        return DataSourceBuilder.create()
                .driverClassName(settings.driver())
                .url(settings.url())
                .username(settings.username())
                .password(settings.password())
                .build();
    }

}
