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. 九度oj-1001-Java

    题目描述:     This time, you are supposed to find A+B where A and B are two matrices, and then count the ...

  2. VS2010自带的性能分析工具分析.NET程序的性能

    这篇博文给大家分享的是,如何使用VS自带的性能分析工具来分析我们编写的.NET程序,一边找出程序性能的瓶颈,改善代码的质量.在实际开发中,性能真的很重要,往往决定一个产品的生死~良好的用户体验的基础之 ...

  3. PKU-2104-K-th Number

    K-th Number Time Limit: 20000MS   Memory Limit: 65536K Total Submissions: 36045   Accepted: 11522 Ca ...

  4. C#.NET常见问题(FAQ)-如何让Listbox支持多选

    把SelectionMode改成MultiExtended   更多教学视频和资料下载,欢迎关注以下信息: 我的优酷空间: http://i.youku.com/acetaohai123   我的在线 ...

  5. ubuntu 上使用valgrind

    Valgrind是一个GPL的软件,用于Linux(For x86, amd64 and ppc32)程序的内存调试和代码剖析.你可以在它的环境中运行你的程序来监视内存的使用情况,比如C 语言中的ma ...

  6. 使用Chrome保存网页为mht文件

    一直在使用chrome浏览器,但由于需要将部分网页保存为mht文件,却发现chrome默认不支持.chrome浏览器默认支持2种:单独的html文件,全部: 万能的chrome怎么可能保存不了mht? ...

  7. 转:nginx基础概念(lingering_close)

    lingering_close,字面意思就是延迟关闭,也就是说,当nginx要关闭连接时,并非立即关闭连接,而是再等待一段时间后才真正关掉连接.为什么要这样呢?我们先来看看这样一个场景.nginx在接 ...

  8. SpringMVC,Ehcache

    来自:http://blog.csdn.net/jadyer/article/details/12257865 http://jinnianshilongnian.iteye.com/blog/200 ...

  9. logback debug 日志没有信息

    可能是项目绑定的日志不是logback的jar包,而是其他包,具体可查看tomcat启动日志 log4j:WARN No appenders could be found for logger (or ...

  10. YII 主题设置

    节日不同,站点显示不同主题.就是解决问题. 也制作多套视图. 不是必需为全部页面设置主题,假设没有.就依照正常视图显示 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5 ...