I want to connect my Java SpringBoot app to SQL Server and I get the information that spring cannot load driver class. I tried:
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
and
spring.datasource.driver-class-name=com.microsoft.jdbc.sqlserver.SQLServerDriver
But both did not work, here is my maven dependency
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
<scope>test</scope>
</dependency>
Class OracleDriver. The Oracle JDBC driver class that implements the java. sql. Driver interface.
The JDBC driver files are installed in C:\program files\microsoft SQL server <ver> JDBC Driver\lib.
According to this web page, the correct property is spring.datasource.driverClassName
.
So, the full connection string should be:
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With