3

我正在尝试使用 JDBC 连接 SQL Server 2008 Express Edition。我已经包含了 SQLServer Driver 3.0 (sqljdbc.jar),我正在使用 JDK 1.5。

以下是我的代码片段:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

con = DriverManager.getConnection("jdbc:sqlserver://10.54.10.190:1433;databaseName=SADB_database", "user", "password");

I am getting below exception:

com.microsoft.sqlserver.jdbc.SQLServerException: The server version is not supported. The target server must be SQL Server 2000 or later.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.DBComms.Prelogin(Unknown Source)
    at com.microsoft.sqlserver.jdbc.DBComms.<init>(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)

请帮助任何人。提前致谢

4

2 回答 2

6

Try to update your driver to Version 4. Version 3.0 is very old.
Alternatively you can use jTDS JDBC Driver. This is a third-party driver but supports much more versions of Microsoft SQLServer.

于 2013-09-05T06:35:06.303 回答
0

升级到 Microsoft JDBC Drivers 4.0 版后,这对我有用

于 2015-08-21T11:20:16.733 回答