我能够使用主机“nash-pc\sqlexpress”的 SQL Server Management Studio 连接到本地计算机上的 MSSQL 2008 Express。但是当我连接 Microsoft JDBC 驱动程序时,它给出如下错误。 JDBC 在主机名中存在“\”问题?我不知道如何使主机名成为“localhost”而不是“nash-pc\sqlexpress”。有趣的是,如果我使用服务器名称作为“localhost”,那么我什至无法连接 SQL Server Management Studio。
"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 连接字符串
Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://nash-pc\sqlexpress:1433;databaseName=jruby
http://www.webxpert.ro/andrei/2009/05/31/enable-tcpip-on-sql-server-2005-express-edition/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)