Add Microsoft SQL JDBC driver to Maven(转)
来源:互联网 发布:未来教育模拟软件 编辑:程序博客网 时间:2024/06/06 12:27
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
- Visit the MSDN site for SQL Server and download the latest version of the JDBC driver for your operating system.
- Unzip the package
- Open a command prompt and switch into the expanded directory where the
jar
file is located. - 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
- 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.
0 0
- Add Microsoft SQL JDBC driver to Maven(转)
- How to add Oracle JDBC driver in your Maven local repository
- How To Add Oracle JDBC Driver In Your Maven Local Repository
- How to add Oracle JDBC driver in your Maven local repository
- Maven_How To Add Oracle JDBC Driver In Your Maven Local Repository
- Microsoft SQL Server JDBC Driver 2.0
- Microsoft SQL Server 2005 JDBC Driver 1.1
- Microsoft SQL Server 2005 JDBC Driver 1.1
- Microsoft JDBC Driver 4.0 for SQL Server
- Microsoft JDBC Driver 4.0 for SQL Server
- microsoft JDBC Driver for SQL Server
- Microsoft SQL Server JDBC Driver 3.0
- java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to jive
- 在JSP中使用 Microsoft JDBC Driver 连接SQL Server2000
- Microsoft SQL Server 2000 Driver for JDBC,连接池
- 微软发布了Microsoft SQL Server 2005 JDBC Driver !
- Microsoft SQL Server 2000 Driver for JDBC 连接数据库
- Microsoft SQL Server 2005 JDBC Driver 1.1的安装
- POJ3187 Backward Digit Sums 【暴搜】
- 用shell脚本将当前目录中每个文件的文件名及其内容显示出来
- DBA入门必须了解的十件事
- JVM运行参数配置
- 《Effective C++》 Reading Note 1
- Add Microsoft SQL JDBC driver to Maven(转)
- SSL与TLS的区别以及介绍
- 求sin三角函数
- UIScrollView滚动条的使用
- [LeetCode] Spiral Matrix
- Android攻破
- sql查询语句中的乱码 -- 前面加N
- cocos2dx-3.2创建项目
- 多核心多线程处理器