생성후 Intellij에서 최초 실행했을 때 오류 발생
Failed to configure a DataSource 에러가 발생하는 이유는 Database에 연결할 때 필요한 정보가 없기 때문
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class}) 추가
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
application.properties에서 설정 추가
spring.datasource.url=jdbc:[Database]://localhost:3306/[Database스키마]
spring.datasource.username=[DB 아이디]
spring.datasource.password=[DB 비밀번호]
spring.datasource.driver-class-name=[JDBC 드라이버]