//pom.xml
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.1.jre8</version>
<scope>runtime</scope>
<!-- scope 从maven仓库拷贝过来时默认是test -->
</dependency>
//application.yml
spring:
datasource:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://172.26.1.4:1433;databaseName=MWBS_Demo4
username: sa
password: Pass2017
主要是 driver-class 和 url 的格式