2011-03-07 71 views
2

我能夠使用SQL Server Management Studio連接到本地計算機上的MSSQL 2008 express,主機爲'nash-pc \ sqlexpress'。但是,當我連接到Microsoft JDBC驅動程序,它給了我像下面的錯誤。 JDBC在主機名中有'\'有問題?我不知道如何讓主機名變成'localhost'而不是'nash-pc \ sqlexpress'。有趣的是,如果我使用服務器名稱作爲'localhost',那麼我甚至無法連接到SQL Server Management Studio。無法使用JDBC連接到msql 2008 Express

The driver encountered an unknown error: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host nash-pc, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.」「

我的JDBC連接字符串

司機:com.microsoft.sqlserver.jdbc.SQLServerDriver

網址:jdbc:sqlserver://nash-pc\sqlexpress:1433;databaseName=jruby

+0

是否啓用遠程連接 – 2011-03-07 04:18:44

回答