Friday, February 5, 2010

com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the named instance has failed. Error: java.net.SocketTimeoutException: Receive timed out

This error will usually occur while trying to connect to named instance of SQL server using JDBC driver.com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the named instance has failed. Error: java.net.SocketTimeoutException: Receive timed out

To correct the problem make sure your named instance passes in the below scenarios.


  • When installing SQL Express, it is necessary to enable mixed mode security as the authentication mode in the advanced configuration options so that connections are possible using the user name and password.

  • Make sure that the SQL Server Browser is enabled.
    • Start-> Programs-> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager.
    • Highlight on SQL Server 2005 Services.
    • In the right pane check to see if "SQL Server Browser" is running. If not, highlight it, right-click and choose Start. 

  • The JDBC provider only works with the TCP/IP protocol which is disabled by default on SSE. Enable the TCP/IP Protocol from the SQL Server Configuration Manager that ships with SSE and re-start the server services.

    • Start-> Programs-> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager.
    • Expand SQL Server 2005 Network Configuration.
    • Highlight Protocols for SQLEXPRESS.
    • In the right pane, check to see if TCP/IP is enabled, if not, enable it and restart the services
  • Check the firewall settings on your computer.Try turning OFF and see if it resolves the issue




  • No comments: