当我尝试运行Spring Boot应用程序时出现以下错误。
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
我正在使用spring Boot 2.0.0以下启动器。
spring Boot 2.0.0
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" }
这是我的application.properties档案
application.properties
spring.datasource.url= ***** spring.datasource.username= ****** spring.datasource.password= ******
正如Stephane Nicoll所说,您的类路径中没有驱动程序。您需要在gradle构建中包括jdbc驱动程序,如下所示。但是,您不必坚持我提供的驱动程序版本。
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') }