There is no JDBC driver for SQL Server in http://search.maven.org/, so you need to install the SQLJDBC jar package locally, and then introduce it in the POM
Step 1
Download SQLJDBC jar package on Microsoft website: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
This download has 4.0 version
Space download Connection Sharing: Https://yunpan.cn/cv3TjJqDZM7zu access password D6BB
Step 2
Install the jar package locally via the MAVEN command.
In the folder with the Sqljdbc4.jar package, open the Command window by shift+ Right-click here, then execute the following MAVEN command
MVN install:install-file-dfile=sqljdbc4.jar-dpackaging=jar-dgroupid=com.microsoft.sqlserver-dartifactid= sqljdbc4-dversion=4.0
Command explanation: mvn install:install-file-dfile= "The absolute path of the jar package"-dpackaging= "file Packaging method"-dgroupid=groupid name-dartifactid=artifactid name- Dversion=jar version
Step 3
Introduction of local jar packages in Pom.xml
<dependency> <groupId>com.microsoft.sqlserver</groupId> <ARTIFACTID>SQLJDBC4 </artifactId> <version>4.0</version></dependency>
Maven adds the JDBC driver package for SQL Server