I use to use MYSQL for my database needs. I switched to MSSQL because somebody wanted me to develop an application on it. I used MS SQL Server 2008 earlier and then upgraded to MS SQL Server 2012. In JDBC, I used the following:
String connectionUrl="jdbc:sqlserver://"+sname+";DatabaseName="+dbname;
where sname is my 'machinename/instancename' (which is correct) and dbname is self explanatory. I also tried various other strings with port numbers. Tried all of this:
1) Right clicked on Sql Server in Sql Management Studio (SMS) -> Connections -> Allow remote connections.
2) Right clicked on Sql Server in Sql Management Studio (SMS) -> Security -> Allow remote connections -> Set Auth mode to Win and Sql auth mode (i.e. mixed mode)
3) Even disabled firewall.
4) Sql Server Configuration Manager -> Network Configuration -> Protocols -> Enabled Shared memory, Named pipes, TCP/IP.
5) SQL Browser service is enabled.
6) Here it says 'Server is listening on [ 'any' 1433]' should be listed in my SQL Server log which ISN'T. Even after repetitive enabling of 1433 as in port.
7) I have also:
Seen a lot of links like these which didn't help. Tried all the answers in this . In the answer somebody mentioned the telnet command. Running the
telnet 127.0.0.1 1433
I get 'Could not open connection to the host, on port 1433: Connection failed'. I've tried port opening through the firewalls advanced settings in Control panel. I have already tried 'advfirewall netsh' to enable ports.
I am using this to basically develop a web application on NetBeans. And a simple matter of database connectivity has taken all day. Its as if Microsoft is making it hard for us to use MS SQL Server.
The error I'm getting is:
se:com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host [host name], port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall."
Can anybody help point out something I'm missing? Here is a view of my Configuration Manager window opened from the 2012 folder (I have both 2008, 2012 folders in my Programs, idk why because after updation shouldn't 2008 version have been removed?):