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. 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.
[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
Hans: I changed IP10 as follows: Active: Yes Enabled: Yes IP Address: 192.168.56.1 TCP Dynamic Ports: 0 TCP Port: 1433 Stopped and restarted SQLSERVER2012 service. Changed DBVis connection string to: jdbc:jtds:sqlserver://192.168.56.1:1433;DatabaseName=AdventureWorks2008R2; Result of connection attempt: Connection refused: connect ... Sql State: 08S01
[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, The TCP Dynamic Ports field should be empty/blank. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Connection refused
Hans: I tried it also with TCP Dynamic Ports blank - same result. I have also tried logging in with SQL Server Authentication, adding user= and password= to the connection string - same result :-(
[This reply is migrated from our old forums.]

Re: Connection refused
Hi Paul, Okay, so in the connection tab you now specify Driver (JDBC): SQL Server (jTDS) Database Server: 192.168.56.1 Database Port: 1433 and a Database Userid and Database Password right? If you click Ping Server, what result do you get? Best Regards, Hans