Unable to create new MS SQL database connection


(Raymond Johnson) #1

Trying to connect to my SQL 2014 server using the named instance as well as the IP address and neither works, under the jTDS or the MS SQL drivers.
MS SQL driver -
Using the named instance returns a “login failed for user” error even though I’m connected via SSMS.
Using the IP address and my login (with AD domain) returns the error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.251.153, port 1433 has failed. Error: “Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.”.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1049)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
at com.ataccama.dqc.commons.sql.util.SimpleDataSource.getConnection(SimpleDataSource.java:89)
at com.ataccama.dqc.internal.commons.sql.AtcDataSource.getConnection(AtcDataSource.java:46)
at com.ataccama.dqc.commons.sql.util.SimpleDataSource.getConnection(SimpleDataSource.java:73)
at com.ataccama.dqc.internal.commons.sql.AtcDataSource.getConnection(AtcDataSource.java:41)
at com.ataccama.dqc.commons.sql.DataSourceImpl.getRawConnection(DataSourceImpl.java:96)
at com.ataccama.dqc.commons.sql.DataSourceImpl.getNonTransactionalConnection(DataSourceImpl.java:64)
at com.ataccama.dqc.gui.ui.wizards.database.DatabaseConnectionModel.testConnection(y:2171)
at com.ataccama.dqc.gui.ui.wizards.database.NewDatabasePage$2.run(y:1917)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

jTDS driver - I get this other error:
java.sql.SQLException: Network error IOException: Connection refused: connect
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:385)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
at com.ataccama.dqc.commons.sql.util.SimpleDataSource.getConnection(SimpleDataSource.java:89)
at com.ataccama.dqc.internal.commons.sql.AtcDataSource.getConnection(AtcDataSource.java:46)
at com.ataccama.dqc.commons.sql.util.SimpleDataSource.getConnection(SimpleDataSource.java:73)
at com.ataccama.dqc.internal.commons.sql.AtcDataSource.getConnection(AtcDataSource.java:41)
at com.ataccama.dqc.commons.sql.DataSourceImpl.getRawConnection(DataSourceImpl.java:96)
at com.ataccama.dqc.commons.sql.DataSourceImpl.getNonTransactionalConnection(DataSourceImpl.java:64)
at com.ataccama.dqc.gui.ui.wizards.database.DatabaseConnectionModel.testConnection(y:2171)
at com.ataccama.dqc.gui.ui.wizards.database.NewDatabasePage$2.run(y:1917)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:304)
at net.sourceforge.jtds.jdbc.SharedSocket.(SharedSocket.java:255)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:310)
… 11 more


(Katrin Popova) #2

Hello Raymond,

Regarding the error “Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.”, you have to check if for the instance name you have enabled TCP/IP and also to make sure that the TCP port is 1433.

Regards,
Katrin