1

I programaticaly configured my DataSource and I'm encountering an error saying:

dataSource or dataSourceClassName or jdbcUrl is required.

I managed to make it work by just changing spring.datasource.url in my .properties file.

Having errors: spring.datasource.url

No errors: spring.datasource.jdbc-url

What I don't know is how does it make it work by just specifying jdbc-url instead of url?

kecoliva
  • 80
  • 1
  • 11
  • 3
    Does this answer your question? [SpringBoot DataSource configuration](https://stackoverflow.com/questions/27175460/springboot-datasource-configuration) – Sangam Belose Dec 04 '19 at 09:56
  • @SangamBelose OP has the opposite issue – Ori Marko Dec 04 '19 at 10:06
  • 1
    Just found an excellent answer from **lapkritinis** https://stackoverflow.com/questions/49088847/after-spring-boot-2-0-migration-jdbcurl-is-required-with-driverclassname – kecoliva Dec 05 '19 at 07:06

1 Answers1

0

This is how the properties are defined in my project:

spring.datasource.url=jdbc:mysql://localhost:3306/mySchema
spring.datasource.username=theUserName
spring.datasource.password=123456
riorio
  • 6,500
  • 7
  • 47
  • 100
  • My property is `spring.main-datasource.url` but that gives me the error `dataSource or dataSourceClassName or jdbcUrl is required.` I managed to make it work by changing `url` to `jdbc-url` – kecoliva Dec 05 '19 at 07:01