spring-security-test/src/main/java/com/security/springsecuritytest/config/DataBaseConfig.java
<reponame>m4a1carbin4/USER-Graduation-Work-Team3-package com.security.springsecuritytest.config;

import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class DataBaseConfig {
    @Bean
    public DataSource dataSource(){
        DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
        dataSourceBuilder.driverClassName("com.mysql.cj.jdbc.Driver");
        dataSourceBuilder.username("root");
        dataSourceBuilder.password("9799");
        dataSourceBuilder.url("jdbc:mysql://localhost:3306/testdb?serverTimezone=UTC&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&useSSL=False");
        return dataSourceBuilder.build();
    }
}
