locked
Connecting to SQL Server 2008 using 2005 JDBC driver RRS feed

  • Question

  • Hello:

    When I tried to connect to a SQL Server 2008 instance using MS' 2005 JDBC driver, I get the following error:

    An error occurred while performing the operation:
    An error occurred while establishing the connection:
    Type: com.microsoft.sqlserver.jdbc.SQLServerException Error Code: 0 SQL State: 08S01
    Message:
    The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.

    Can somebody help me resolve this problem? Also, how do I find out that it is port 1433 on my machine. I snooped around and cannot verify that my instance is running on that port.

    Venki

    Thursday, September 25, 2008 3:47 PM

Answers

  • Do you have SQL Server listening on the static TCP port?

     

    Go to SQL Server Configuration Manager -> ... -> Protocols for MSSQLSERVER, enable TCP/IP, right-click TCP-IP -> Properties -> IP Addresses tab -> IPAll section, clear "TCP Dynamic Ports" and set "TCP Port" to 1433. Restart the SQL Server.

     

    Can you connect to your SQL Server via telnet "telnet <SQL Server host name> 1433" ?

     

    Thursday, September 25, 2008 4:45 PM

All replies

  • And, I have the port added to and enabled in my Windows Firewall Exception list.

     

    Thursday, September 25, 2008 3:57 PM
  • Do you have SQL Server listening on the static TCP port?

     

    Go to SQL Server Configuration Manager -> ... -> Protocols for MSSQLSERVER, enable TCP/IP, right-click TCP-IP -> Properties -> IP Addresses tab -> IPAll section, clear "TCP Dynamic Ports" and set "TCP Port" to 1433. Restart the SQL Server.

     

    Can you connect to your SQL Server via telnet "telnet <SQL Server host name> 1433" ?

     

    Thursday, September 25, 2008 4:45 PM
  • Thanks, Oleg.

     

    After making the change, I am able to connect to the server.

     

    Venki

    Thursday, September 25, 2008 5:18 PM
  • I recently installed the 64-bit versio of Windows 2008 Server.

     

    I downloaded and extracted JDBC Service pack 2 drivers. I am using a 3-rd party tool (dbVisualizer). When I point the tool to sqljdbc4.jar, it says "No new driver classes."

     

    I used the same zip file and extracted them on a machine that has 32-bit Windows 2008 Server and dbVisualizer sees the class.

     

    Can somebody explain how I can resolve the issue?

     

    Thanks.

     

    Brian

     

    Tuesday, October 21, 2008 6:42 PM
  • I'm running into the same issue with my connection, did you ever find a solution?

    Monday, December 20, 2010 2:55 PM