Java系列: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
jarfile is located. - Execute the following command. Be sure to modify the
jarfile name and version as necessary: - You should see something similar to this:
|
1
|
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 |
|
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.
http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/
Java系列:Add Microsoft SQL JDBC driver to Maven的更多相关文章
- Add Microsoft SQL JDBC driver to Maven(转)
from:http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/ Add Microsoft SQL JDBC driv ...
- 添加Microsoft SQL JDBC driver 到 Maven
主要步骤如下: 1. 本地下载sqljdbc4.jar 2. 解压到本地文件夹中,并找到sqljdbc4.jar路径 3. 打开命令窗口,打开至工程目录,执行以下语句(前提:先配置好maven环境变量 ...
- java中myeclipse连接mysql问题(java.lang.ClassNotFoundException: com.mysql.jdbc.Driver)
java中myeclipse连接mysql问题(java.lang.ClassNotFoundException: com.mysql.jdbc.Driver) 1.往项目中添加mysql-conne ...
- Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?
不多说,直接上干货! 问题详情 [hadoop@bigdatamaster oozie--cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -ru ...
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver解决方式
昨天整理桌面的时候将桌面的一堆文件移动到F盘去了,结果导致原来建的一些项目名称所有出现红色感叹号,打开一看,原来是由于我把hibernate的那些jar包移走了.导致user library里那些ja ...
- java链接MySQL数据库时使用com.mysql.jdbc.Connection的包会出红线问题 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver问题
package com.swift; //这里导入的包是java.sql.Connection而不是com.mysql.jdbc.Connection import java.sql.Connecti ...
- 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 ...
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver问题
java.lang.ClassNotFoundException: com.mysql.jdbc.Driverat org.apache.catalina.loader.WebappClassLoad ...
- Idea运行web项目时,提示java.lang.ClassNotFoundException: com.mysql.jdbc.Driver解决方法
今天用 idea写了个工程.结果最后报错,错误信息如下: java.lang.ClassNotFoundException: com.mysql.jdbc.Driverat org.apache.ca ...
随机推荐
- iOS开发之网络数据解析(一)--JSON解析简介
前言:对服务器请求之后,返回给客户端的数据,一般都是JSON格式或者XML格式(文件下载除外) 本篇随便先讲解JSON解析. 正文: 关于JSON: JSON是一种轻量级的数据格式,一般用于数据交互 ...
- Cocos2d-x 基础元素
看过本章,然后实践之后,应该会掌握以下的认识: 1.Cocos2d-x引擎的基本运转过程 2.Cocos2d-x引擎的一些初始设置 3.对导演及图层及现实对象的认识 4.如何定义自己的显示对象 *:f ...
- iTerm和Alfred 2的安装和使用
小贴士:本博文所有的下载资源都在文章末尾 当你下载好所有需要的资源之后,就可以安装这两个装逼神器了: iTerm的安装和使用 首先是安装终端相关的装逼神器 先把archey拷贝到bin目录下,补充图示 ...
- Dev Grid拖拽移动行
效果图 源码下载 拖拽时带行截图效果实现代码 /// <summary> /// 拖拽帮助类 /// </summary> public static class DragHe ...
- Docker容器操作
启动一次容器并执行命令(执行完命令后结束): docker run centos cat /etc/redhat-release 启动容器进入交互模式: docker run -i -t centos ...
- ASP.NET导出bdf文件
1.导出助手类 using System;using System.IO;using System.Data;using System.Data.OleDb;using System.Web;usin ...
- python set集合简单使用
Python 提供了强大的集合操作方法,我们可以完成数学中集合的并集.交集.差集等操作,如下: >>> a = {1,2,3} >>> b = {3,4,5} &g ...
- 初识zookeeper(一)之zookeeper的安装及配置
1.简要介绍 zookeeper是一个分布式的应用程序协调服务,是Hadoop和Hbase的重要组件,是一个树型的目录服务,支持变更推送.除此还可以用作dubbo服务的注册中心. 2.安装 2.1 下 ...
- ggplot2颜色操作
1.颜色列表
- nginx 配置单入口
# 略... location / { try_fiels $uri $uri/ /index.php; } # 略...