Start a new topic

Connection refused

[This topic is migrated from our old forums. The original author name has been removed]

I am trying to connect to the Adventure Works d/b but keep getting a 'connection refused' message. These are the settings I have established a. enabled TCP/IP b. opened port 1433 in Windows Firewall as database port c. driver jTDS d. URL/Name: jdbc:jtds://localhost:1433;DatabaseName=AdventureWorks2008R2 e: userid: same as used for SQL Management Studio login f: added 'workgroup' as domain g: authentication method: Windows From reading the FAQs and posts here I thought I'd got everything in place. So am I missing something? TIA

[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, Thanks. Only the first attempt has valid values. SQLSERVER2012 is the name of a SQL Server database instance, not a server DNS name, so it cannot be used the way you use it. Either way, even with the correct settings it fails at the network level. The screenshots you have sent me so far indicates that the SQL Server is configured correctly, and you say you have restarted the server after the TCP/IP reconfiguration. That leaves me with only one more suggestion. You said that your PC is 64-bit. If the Java version you are running is 32-bit and/or the DbVisualizer installer you used is 32-bit, this can cause some very odd problem. I therefore suggest that you: 1) Unistall the DbVisualizer you have installed now, 2) Download and install the "Windows x64 (setup installer) With Java VM", 3) Try again with the settings from the first attempt in the document you posted. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Hans: I followed your suggested steps (installed DbVIS 64-bit with JVM), added the settings you suggested (Server: 192.168.56.1, Port 1433, Authentication: SQL Server) - result: connection refused. I guess we've reached the end of the road :-(
[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, Yes, I'm out of ideas. But I can tell you that the problem is with the network configuration somewhere. The fact that you get "connection refused" and that Ping Server gives you an error means that it is simply not possible to set up a TCP/IP connection to port 1433 on 192.168.56.1. You will have then same problem with any client that uses TCP/IP to communicate with the database. I have asked about all configuration items I can think of that could explain this, and your answers indicate that those areas are set up correctly. You may want to continue looking for a solution by Googling on selected terms like "SQL Server JDBC TCP/IP connection refused". Sorry I couldn't help you. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Hans: thanks anyway. > You may want to continue looking for a solution by Googling on selected terms like "SQL Server JDBC TCP/IP connection refused". I have been doing this and everything I found I have implemented - and it was the same advice as you have given. So something not right on this laptop. Thanks again.
[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, Enable one of the IP addresses, set its TCP Port to 1433 and leave the TCP Dynamic Ports filed empty. Then use this IP address as the Database Server value for the DbVisualizer connection. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Forgot to add: I'm on 64-but Windows 7 using 64-bit DbVisualizer.
[This reply is migrated from our old forums.]

Re: Connection refused
Paul, The connection refused error is a typical networking error when the JDBC driver is not able to establish connection. I suggest you first try to connect using SQL Server authentication only. If it still fail, open a command shell and telnet to the DB server: telnet localhost 1433 If the database server respond you should get something like the following: Trying 192.168.1.131... Connected to 192.168.1.131. Escape character is '^]'. If it doesn't respond: telnet: connect to address 192.168.1.131: Connection refused telnet: Unable to connect to remote host What is the result if you try this? Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Roger: thanks for the reply. I changed to Mixed Mode Authentication in SQL Management Studio i.e. Windows and SQL Server. That did not work and issuing 'telnet localhost 1433' in a command shell gave "Could not open connection with the host on port 1433: connection failed".
[This reply is migrated from our old forums.]

Re: Connection refused
Paul, Since telnet fail it indicate there is no database server available on that host/port. Is the port really 1433 as specified in the SQL Server mgmt console? Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Roger: checking via SQL Management Studio Server Configuration facility, under TCP/IP Properties port 1433 is enabled by default. I can access the database via SQL Server Management Studio.
[This reply is migrated from our old forums.]

Re: Connection refused
Paul, Connecting through the JDBC driver use TCP/IP to communicate with the database. The mgmt studio may very well use some other communication layer such as ODBC. You need to make sure that at least telnet to the host/port don't result in a connection refused message. Once that work, DbVisualizer should work as well. I suggest you check with your DBA or sysadmin for further advice. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Roger: I tried another approach - connection via a Database URL (rather than by Server Info). I entered the URL thus: jdbc:jtds:sqlserver://\SQLSERVER2012:1433;DatabaseName=AdventureWorks2008R2 When I press 'Connect' I get 'Connecting, please wait' (which is an advance on what happened before) and then a message "Could not create socket ... SQL State 08501' I've tried it with ...//localhost\SQLSERVER2012...and ...//SQLSERVER2012... but get 'Unknown server host name'. Not sure what to do next - I don't have a DBA/sysadmin - that 's me :-)
[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, There is definitely something wrong either with the network configuration of the database server or the info you enter in DbVisualizer. 1) Open the SQL Server Configuration Manager, 2) Expand the SQL Server Network Configuration node 3) Select the Protocols for node, 3) Is the TCP/IP protocol enabled? 4) If it is, open its Properties dialog and the IP Addresses tab in the dialog 5) Does it one IP that is Active, Enabled, with TCP Port set to 1433? If so, what is the IP Address set to? In DbVisualizer, use the Server Info setting for the connection and enter the IP Address from the last step, assuming all configuration was correct. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Hans: in the Configuration Utility I first checked the SQL Native Client 11.0 Configuration. Under Client Protocols -> TCP/IP this shows Default Port: 1433 and Enabled:Yes. Looking in SQL Server Network Configuration and the SQLSERVER2012 -> TCP/IP entry, this is Enabled: Yes. When I look at all of the IP Addresses, they are all Active but none is enabled. TCP Dynamic Ports is 0 for all entries except the last entry, IPAll which has a Dynamic Port of 1036. For SQL Server I have always accepted the default settings (which is port 1433) and everything has worked fine. So I am a bit unsure of how to proceed with DBVis.