最近把公司的项目搭建到本地(周末回家要加班),可是连接后,发现程序后台出错,错误信息:不支持此服务器版本。目标服务器必须是 SQL Server 2000 或更高版本。

本地是SqlServer2008,公司是SqlServer2005,分析后发现,是引用的JDBC 驱动程序版本导致的。

微软的连接jar包有两个:sqljdbc.jar 和 sqljdbc4.jar。他们的对比如下:

1,sqljdbc.jar:

    sqljdbc.jar 类库提供对 JDBC 3.0 的支持。

    sqljdbc.jar 类库要求使用 5.0 版的 Java 运行时环境 (JRE)。连接到数据库时,在 JRE 6.0 上使用 sqljdbc.jar 会引发异常。

2,sqljdbc4.jar:
     sqljdbc4.jar 类库提供对 JDBC 4.0 的支持。它不仅包括 sqljdbc.jar 的所有功能,还包括新增的 JDBC 4.0 方法。 
             sqljdbc4.jar 类库 要求使用 6.0 或更高版本的 Java 运行时环境 (JRE)。在 JRE 1.4 或 5.0 上使用 sqljdbc4.jar 会引发异常。
 
所以把sqljdbc.jar替换为sqljdbc4.jar就可以了。 
 
  注:关于微软官方jar的下载连接:

http://www.microsoft.com/downloads/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displayLang=zh-cn

选择下载后,解压"2052\sqljdbc_3.0.1301.101_chs.tar.gz", 文件后,里面包含的sqljdbc.jar与sqljdbc4.jar。选择自己需要的版本即可。

作者:Darren

微博:@IT_攻城师

github:@Darren90

出处:http://www.cnblogs.com/fengtengfei/

FengTengfei'Blog:darren90.github.com

连接sql2008时报错的更多相关文章

  1. 【small项目】MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

    MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link ...

  2. 【转载】在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support

    在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone config ...

  3. 解决使用DBeaver连接MySQL时报错-The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

    解决使用DBeaver连接MySQL时报错,其实提示很明显. The server time zone value '�й���׼ʱ��' is unrecognized or represents ...

  4. redis连接超时报错

    应用程序连接redis超时,报错如下: ERROR DubboServerHandler-xxx.xx.xx.52:20880-thread-172 2016-12-21 15:25:20,429 c ...

  5. AlwaysOn配置时在连接步骤时报错(35250)

    1.错误描述 1XX.XXX.XXX.241(主节点) 1XX.XXX.XXX.242(从节点) 添加节点需要在主节点上执行的,错误代码:35250 报错截图 2.网上相关介绍都是怀疑端口5022的问 ...

  6. 使用pymongo连接mongodb时报错:pymongo.errors.OperationFailure: not authorized

    连接本机或局域网部署的mongodb时可以用以下方法: from urllib import parse from pymongo import MongoClient host = '*.*.*.* ...

  7. 连接opcserver时报错 connecting to OPC Server "****" CoCreateInstance 服务器运行失败

    在普通windows系统连接OPCServer可能会报这样的错,排查很长时间,OPCServer跟Client都运行正常,点号录入也正常. 最后发现,其实是OPCServer 与OPCClient 权 ...

  8. 如何处理Win7连接vpn时报错789的问题

    [转]VPN错误提示: vpn连接出错789:L2TP连接尝试失败,因为安全层在初始化与远程计算机的协商时遇 (2014-08-11 15:09:10)转载▼标签: it xp连接VPN错误提示: v ...

  9. 使用PLSql连接Oracle时报错ORA-12541: TNS: 无监听程序

    非常多时候为了优化我们的启动项把oracle的服务禁止了.但是重新启动启动之后使用PLSQL登陆oracle时会出现无监听程序,这说明我们有一些服务没有启动.我们先查看一下oracle的服务是否启动, ...

随机推荐

  1. @ApiParam @RequestParam @PathVariable 用法

    文章来源:https://www.cnblogs.com/hello-tl/p/9204279.html 1.@ApiParam ,是注解api的参数 ,也就是用于swagger提供开发者文档 ,文档 ...

  2. 【HDU 6153】A Secret (KMP)

    Problem Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,whi ...

  3. Using TCP keepalive under Linux

    Linux has built-in support for keepalive. You need to enable TCP/IP networking in order to use it. Y ...

  4. URAL 2040 Palindromes and Super Abilities 2

    Palindromes and Super Abilities 2Time Limit: 500MS Memory Limit: 102400KB 64bit IO Format: %I64d &am ...

  5. Python内置函数—bytearray

    英文文档: class bytearray([source[, encoding[, errors]]]) Return a new array of bytes. The bytearray cla ...

  6. CodeForces 610B-Vika and Squares,有坑点,不是很难~~

    B. Vika and Squares time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  7. iOS第三方地图-百度地图中心点定位

    使用百度地图定位后,滑动地图,使用反编码确定地图中心店的位置信息 // // MapControl.m // quyizu // // Created by apple on 15/9/2. // C ...

  8. [codeforces538F]A Heap of Heaps

    [codeforces538F]A Heap of Heaps 试题描述 Andrew skipped lessons on the subject 'Algorithms and Data Stru ...

  9. HDU 4578 线段树复杂题

    题目大意: 题意:有一个序列,有四种操作: 1:区间[l,r]内的数全部加c. 2:区间[l,r]内的数全部乘c. 3:区间[l,r]内的数全部初始为c. 4:询问区间[l,r]内所有数的P次方之和. ...

  10. POJ 3680: Intervals【最小费用最大流】

    题目大意:你有N个开区间,每个区间有个重量wi,你要选择一些区间,使得满足:每个点被不超过K个区间覆盖的前提下,重量最大 思路:感觉是很好想的费用流,把每个区间首尾相连,费用为该区间的重量的相反数(由 ...