简体   繁体   English

什么是SQL Server JDBC的驱动程序类名称

[英]What's the driver class name for SQL Server JDBC

I want to connect my Java SpringBoot app to SQL Server and I get the information that spring cannot load driver class. 我想将我的Java SpringBoot应用程序连接到SQL Server,并获得spring无法加载驱动程序类的信息。 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 但两者都没有用,这是我的maven依赖

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>7.0.0.jre8</version>
    <scope>test</scope>
</dependency>

According to this web page , the correct property is spring.datasource.driverClassName . 根据此网页 ,正确的属性是spring.datasource.driverClassName

So, the full connection string should be: 所以,完整的连接字符串应该是:

spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM