1. //pom.xml
    2. <dependency>
    3. <groupId>com.microsoft.sqlserver</groupId>
    4. <artifactId>mssql-jdbc</artifactId>
    5. <version>6.2.1.jre8</version>
    6. <scope>runtime</scope>
    7. <!-- scope 从maven仓库拷贝过来时默认是test -->
    8. </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 的格式