Quantcast
Viewing all articles
Browse latest Browse all 3

Add Microsoft SQL Server JDBC driver to Maven

Problem

I can’t use Microsoft SQL Server JDBC driver in Java project while using maven.

Solution

  1. Download the Microsoft SQL Server JDBC driver from MSDN site
  2. Unzip the package
  3. Navigate in command prompt into the directory with unzipped files and execute the following command
    mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
  4. You should see BUILD SUCCESS message.
  5. Modify your pom.xml
<dependency>
   <groupId>com.microsoft.sqlserver</groupId>
   <artifactId>sqljdbc4</artifactId>
   <version>4.0</version>
</dependency>

Viewing all articles
Browse latest Browse all 3

Trending Articles