Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource Spring Boot

I am getting following error when I try to run spring boot application.

Description:

Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:

    Property: driverclassname
    Value: oracle.jdbc.OracleDriver
    Origin: "driverClassName" from property source "source"
    Reason: Unable to set value for property driver-class-name

Action:

Update your application's configuration

This is same issue I have but i am not using maven.

I am using spring Boot 2.0.0 with following starters.

dependencies {
    compile "org.springframework.boot:spring-boot-starter-web"
    compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1"
    testCompile "org.springframework.boot:spring-boot-starter-test"
}

And this is my application.properties file

spring.datasource.url= *****
spring.datasource.username= ******
spring.datasource.password= ******

Same problem with me (Spring boot 2),

I Fixed add driver-class.

Look up application.properties file.

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

Full code.

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=upate
spring.datasource.url=jdbc:mysql://localhost:3306/database_name
spring.datasource.username=admin
spring.datasource.password=admin1234

As Stephane Nicoll said, you don't have driver on your classpath. You need to include jdbc driver on your gradle build as below. However, you don't have to stick to driver version that I have included.

dependencies {
    compile "org.springframework.boot:spring-boot-starter-web"
    compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1"
    testCompile "org.springframework.boot:spring-boot-starter-test"
    runtime('com.oracle:ojdbc7:12.1.0.2.0') 
}

I have added the below in properties file

spring.datasource.driverclassname = com.mysql.jdbc.Driver hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

and added the below in POM file

        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>

It is working fine now.


I had the same error when updating from Spring Boot 2.0.6 to Spring Boot 2.1.6.

Explicitly setting driver class name spring.datasource.driver-class-name=com.mysql.jdbc.Driver in application.properties has resolved the issue


You have to add

   <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency> 

dependency in your pom.xml file