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

孤街醉人 提交于 2019-12-31 02:15:53

问题


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

  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.


回答1:


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

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

It sounds like you're running 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...)




回答2:


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

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+ ";";


来源:https://stackoverflow.com/questions/12732957/java-sql-sqlexception-sql-server-version-8-is-not-supported-by-this-driver-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!