[Spring boot] debug 기록 - 최초 실행 시 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Runtime Error·2021년 2월 27일
0

Spring Boot

목록 보기
1/1

Initializr를 통해 생성 한 뒤 최초 실행 할 경우 다음과 같은 오류가 발생하면서 정상적으로 실행이 되지 않은 경우의 debug 기록이다. 본인은 oracle을 이용한 프로젝트였으며 다른 DB를 이용할 경우 코드를 응용하여 사용하면 된다.

오류

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

해결방법1

# Database
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.url=jdbc:oracle:thin: // "@localhost:접속포트/SID"
spring.datasource.username= //"DB접속 ID"
spring.datasource.password= //"DB접속 PW"
spring.datasource.sql-script-encoding=UTF-8
profile
Hello World

0개의 댓글