December 09, 2014

Manually Adding Dependency in Spring MicroSoft SQLServer JDBC Driver

Hi Friends,

Today, I’ve spent more than 40 minutes in understanding the process and setting up the SQLServer JDBC Driver in Spring manually

Pre-requisites

Maven (Download from http://maven.apache.org/download.cgi and add the maven path to environment variables)

Procedure

  1. Download the latest Microsoft JDBC driver for SQL Server from the following official link http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
  2. I’ve selected sqljdbc jar version 4.0
  3. Navigate to the extracted folder where .jar files available in command prompt
  4. Execute the following command
  5. cmd> mvn install:install-file -DgroupId=com.microsoft.sqlserver.jdbc -DartifactId=sqljdbc -Dversion=4.0 -Dpackaging=jar -Dfile="sqljdbc4.jar"
     
  6. Now you should be able to see the downloading and moving the corresponding .jar and .pom files. Then a message “BUILD SUCCESS” will appear in command prompt.
  7. Add the following dependency to your pom.xml
<!-- Database -->
<dependency>
<groupId>com.microsoft.sqlserver.jdbc</groupId>
<agtifactId>sqljdbc</agtifactId>
<version>4.0</version>
</dependency>

    Now you run the project and enjoy the usage of SQLServer Database with Spring.

    Please send your feedback and comments to psrdotcom@gmail.com

    Blogger Labels: Dependency,MicroSoft,SQLServer,JDBC,Driver,Friends,Procedure,Download,Server,version,Navigate,folder,Execute,DgroupId,DartifactId,Dversion,Dfile,message,BUILD,Database,usage,feedback,sqljdbc,groupId,artifactId

    No comments:

    Featured Post

    Java Introdcution

    Please send your review and feedback to psrdotcom@gmail.com