from:http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/

Add Microsoft SQL JDBC driver to Maven

 
 

Maven does not directly support some libraries, like Microsoft’s SQL Server JDBC. This tutorial will show you how to add an external dependency to your local Maven repository. It assumes you have already installed Maven.

Download the JDBC driver for Microsoft SQL Server

    1. Visit the MSDN site for SQL Server and download the latest version of the JDBC driver for your operating system.
    2. Unzip the package
    3. Open a command prompt and switch into the expanded directory where the jar file is located.
    4. Execute the following command. Be sure to modify the jar file name and version as necessary:
1
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
    1. You should see something similar to this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing /Users/claude/installers/JDBC/sqljdbc_4.0/enu/sqljdbc4.jar to /Users/claude/.m2/repository/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.jar
[INFO] Installing /var/folders/c6/q1bdtq557kv54783p1g6cbsw0000gp/T/mvninstall1874482299687761721.pom to /Users/claude/.m2/repository/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.208s
[INFO] Finished at: Tue Mar 13 14:07:31 EDT 2012
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------

Modify your POM

Include the new dependency by modifying your project’s pom.xml. Add the following dependency:

1
2
3
4
5
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
</dependency>

Save the pom.xml file and build the project to make sure no errors exist.

Add Microsoft SQL JDBC driver to Maven(转)的更多相关文章

  1. Java系列:Add Microsoft SQL JDBC driver to Maven

    Maven does not directly support some libraries, like Microsoft's SQL Server JDBC. This tutorial will ...

  2. 添加Microsoft SQL JDBC driver 到 Maven

    主要步骤如下: 1. 本地下载sqljdbc4.jar 2. 解压到本地文件夹中,并找到sqljdbc4.jar路径 3. 打开命令窗口,打开至工程目录,执行以下语句(前提:先配置好maven环境变量 ...

  3. unkow jdbc driver : http://maven.apache.org

    报了这么一个错,找了很久才找到问题出在哪里,具体为什么会什么出现现在还不怎么懂,只是现在能让它继续跑起来 这个错是因为我的spring-mybatis.xml文件读取不了jdbc.properties ...

  4. Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)非官方的PHP SQL Server 驱动

    原文 Unofficial Microsoft SQL Server Driver for PHP (sqlsrv) Here are unofficial modified builds of Mi ...

  5. 下载 Microsoft JDBC driver 7.2 for SQL Server

    下载 Microsoft JDBC driver 7.2 for SQL Server:https://www.microsoft.com/zh-cn/download/confirmation.as ...

  6. 下载 Microsoft SQL Server JDBC 驱动程序

    JDBC 驱动程序中使用 Maven 中心 JDBC 驱动程序可以通过将其添加为依赖项在 POM.xml 文件中使用以下代码添加到 Maven 项目: XML复制 <dependency> ...

  7. 【转】Install Oracle Jdbc driver in your Maven local repository

    Install Oracle Jdbc driver in your Maven local repository If you are using Oracle, you must first in ...

  8. [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket错误解决方法总结

    今天做一个特殊的业务处理,用JDBC连接SQLServer数据库载入驱动的时候,报例如以下错误: java.sql.SQLException: [Microsoft][SQLServer 2000 D ...

  9. Microsoft SQL Server JDBC 驱动程序支持矩阵

    本页包含 Microsoft SQL Server JDBC 驱动程序的支持矩阵和支持生命周期策略. Microsoft JDBC 驱动程序支持生命周期矩阵和策略 Microsoft 支持生命周期 ( ...

随机推荐

  1. 漂亮的CSS3提交意见输入框样式

    做了个输入框样式,如图: CSS代码如下: <喎�"http://www.2cto.com/kf/ware/vc/" target="_blank" cl ...

  2. 引用外部jquery.js

    使用 Google 的 CDN <head> <script type="text/javascript" src="http://ajax.googl ...

  3. ASP.NET MVC 重命名[命名空间]而导致的错误及发现的ASP.NET MVC Bug一枚

    使用VS2012新建了一个Asp.net mvc5的项目,并把项目的命名空间名称更改了(Src更改为UXXXXX),然后就导致了以下错误 刚开始以后是项目的属性中的命名空间没有更改过来的问题,但我在重 ...

  4. PHP构造函数的重载

    由于PHP是弱类型语言,因此函数的输入参数类型无法确定(可以使用类型暗示,但是类型暗示无法用在诸如整型,字符串之类的标量类型上),并且对于一个函数,比如只定义了3个输入参数,PHP却运行调用的时候输入 ...

  5. [Functional Programming] Create Reusable Functions with Partial Application in JavaScript

    This lesson teaches you how arguments passed to a curried function allow us to store data in closure ...

  6. ASP入门(十五)- Global.asa

    Global.asa 文件是一个可选文件,它可包含被 ASP 应用程序中每个页面访问的对象.变量和方法的声明.所有合法的浏览器脚本都可以在 Global.asa 中使用. Global.asa 文件只 ...

  7. 【Python】torrentParser1.00

    代码: #------------------------------------------------------------------------------------ # torrentP ...

  8. Virtualbox安装Ubuntu

    每次安装虚拟机都是总要折腾一下,毕竟不是特别熟悉,几个小细节总要google半天,为了以后能愉快的玩耍.把这些问题都记录下来,免得再折腾. 此文档都来自其他人的文章,我保存在Evernote整理. 网 ...

  9. C++中public、protected、private的差别

    第一: private,public,protected的訪问范围:   private: 仅仅能由该类中的函数.其友元函数訪问,不能被不论什么其它訪问.该类的对象也不能訪问. protected: ...

  10. Visual Studio修改可执行程序的文件名和路径