Reputation: 11
Unable to figure out what is causing the issue.
My application.properties file
spring.datasource.url = "jdbc:mysql://localhost:3306/Medical_Tracking?useSSL=false"
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=true
Quick help is appreciated
Upvotes: 1
Views: 9120
Reputation: 5543
You may also get this error in case you are using wrong value for any of the datasource setting.
I was using driver class name in place of url
@Bean
@BatchDataSource
public DataSource batchDataSource() {
return DataSourceBuilder.create().url(batchDbDriver)
.driverClassName(batchDbDriver).username(batchDbUsername)
.password(batchDbPassword)
.build();
}
@Bean
@BatchDataSource
public DataSource batchDataSource() {
return DataSourceBuilder.create().url(batchDbUrl)
.driverClassName(batchDbDriver).username(batchDbUsername)
.password(batchDbPassword)
.build();
}
Upvotes: 0
Reputation: 61
Your config spring.datasource.url
should not use double quotes ("
)
instead of:
spring.datasource.url = "jdbc:mysql://localhost:3306/Medical_Tracking?useSSL=false"
use:
spring.datasource.url = jdbc:mysql://localhost:3306/Medical_Tracking?useSSL=false
Upvotes: 6
Reputation: 748
Try following change in applications.properties file:
Replace
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
with
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
Upvotes: -1