日期:2014-05-20  浏览次数:20862 次

jdbc连sqlserver2000总提示错误,我已导入了那三个jar包?
错误的提示内容为:
java.sql.SQLException:   [Microsoft][SQLServer   2000   Driver   for   JDBC]Error   establis
hing   socket.
                at   com.microsoft.jdbc.base.BaseExceptions.createException(Unknown   Source
)
                at   com.microsoft.jdbc.base.BaseExceptions.getException(Unknown   Source)
                at   com.microsoft.jdbc.base.BaseExceptions.getException(Unknown   Source)
                at   com.microsoft.jdbc.sqlserver.tds.TDSConnection. <init> (Unknown   Source)

                at   com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown   Sou
rce)
                at   com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown   S
ource)
                at   com.microsoft.jdbc.base.BaseConnection.open(Unknown   Source)
                at   com.microsoft.jdbc.base.BaseDriver.connect(Unknown   Source)
                at   java.sql.DriverManager.getConnection(DriverManager.java:525)
                at   java.sql.DriverManager.getConnection(DriverManager.java:171)
                at   TestDB.getConnection(TestDB.java:25)
                at   TestDB.displayDbProperties(TestDB.java:42)
                at   TestDB.main(TestDB.java:78)
Error   Trace   in   getConnection()   :   [Microsoft][SQLServer   2000   Driver   for   JDBC]Erro
r   establishing   socket.
Error:   No   active   Connection
Press   any   key   to   continue...

------解决方案--------------------
打mssql的sp4补丁……
------解决方案--------------------
数据库应为混合模式,2000的补丁SP4,SQLJDBC有自己的连接示范,测试下看看结果