该问题可能是基本问题,如果是,请原谅我。我试图将我的Android应用连接到MSSQL服务器。我在下面的链接中使用了相同的代码。我已经按照这个链接所选择的答案用sqljdbc 4.3.0:与主机server.com/Db_name,端口1433的TCP/IP连接失败
com.mysql.jdbc.driver class not found exception
当我做这个,成功调试,但是当我在我的设备是三星Galaxy Y(姜饼)上运行它,它给我这个错误:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server.com/Db_name, port 1433 has failed. Error: "null. 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.".
任何帮助将不胜感激。
编辑:我在模拟器上运行它,它在文本视图中出现此错误。
你说了什么,我现在明白了。 com.microsoft.sqlserver.jdbc.SQLServerException:与主机server.com,名为实例Db_name的连接失败。错误: “Java.net.SocketTimeoutException”。验证服务器和实例名称,检查没有防火墙将UDP通信阻塞到端口1434,并且对于SQL Server 2005或更高版本,验证SQL Server Browser Service是否在主机上运行。我正在使用SQL Server 2005. – 2013-03-08 08:16:34
看看这个问题:http://stackoverflow.com/questions/8911376/the-connection-to-the-host-server-failed-java – jlopez 2013-03-08 08:21:19
我已经看到它。没什么帮助。 – 2013-03-08 08:34:58