Answer the question
In order to leave comments, you need to log in
What is the cause of the error: Failed to configure a DataSource?
I have a posgres database named mydate. I want to connect to it in spring boot application. In settings project_name/src/main/resources/application.yml I write:
spring:
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/mydate
username: test_user
password: qwerty
But still error: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
The base dependency and its subkey driver are:
spring-boot-starter-data-jpa
org.postgresql
Answer the question
In order to leave comments, you need to log in
Okay Google - spring yml datasource Opening the
first link on SO
spring:
jpa:
database: POSTGRESQL
show-sql: true
hibernate:
ddl-auto: create-drop
datasource:
platform: postgres
url: jdbc:postgresql://localhost:5432/mydb
username: foo
password: bar
driverClassName: org.postgresql.Driver
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question