java.sql.SQLException: 此驱动程序不支持 SQL Server 版本 8。SQL 状态 = 08S01,错误代码 = 0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12732957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 10:00:32  来源:igfitidea点击:

java.sql.SQLException: SQL Server version 8 is not supported by this driver. SQL State = 08S01, Error Code = 0

javasql-server-2008websphere-7

提问by Ravinder

I have upgraded my application to Websphere 7.0from Websphere 6.1.I am using Microsoft SQL server jdbc driver 4.0for this application. When i use sqljdbc4.jari get the following error when connecting to database for authentication.

我已经升级我的应用程序Websphere 7.0Websphere 6.1.我使用Microsoft SQL server jdbc driver 4.0这个应用程序。当我使用sqljdbc4.jar连接到数据库进行身份验证时出现以下错误。

  SystemError java.sql.SQLException: SQL Server version 8 is not supported by this driver. SQL State = 08S01, Error Code = 0

How to get rid of this.

如何摆脱这种情况。

回答by Jon Skeet

Yes, as per the Microsoft SQL Server JDBC type 4.0 driver system requirements page:

是的,根据Microsoft SQL Server JDBC 类型 4.0 驱动程序系统要求页面

The JDBC driver supports connections to a SQL Azure Database and SQL Server 2005 and later.

JDBC 驱动程序支持连接到 SQL Azure 数据库和 SQL Server 2005 及更高版本。

It sounds like you're running SQL Server 2000.

听起来您正在运行 SQL Server 2000。

Either change driver (e.g. to jTDS) or upgrade to a more recent release of SQL Server (which would presumably be a rather bigger task...)

更改驱动程序(例如到jTDS)或升级到更新版本的 SQL Server(这可能是一个相当大的任务......)

回答by dsandrade

You not need change your driver, only your url connection. Try this:

您无需更改驱动程序,只需更改 url 连接。试试这个:

String url = "jdbc:sqlserver://"+SERVER+":"+PORT+";databaseName="+DATABASE+ ";user=" +USER+ ";password=" +PASS+ ";";

change for

为。。改变

String url ="jdbc:jtds:sqlserver://"+SERVER+":"+PORT+";databaseName="+DATABASE+ ";user=" +USER+ ";password=" +PASS+ ";";