Unable to establish sql server connection from my rh vm to the windows sql server

Posted on

Hi team,Good day...
1:I am running rhel7.4 (on a virtual box) and jboss eap7(on a virtual box) to deploy and test my war.
2:The database is residing in my host machine windows 10.
Databases are 1:oracle and 2:microsoft sql server, both on windows.

3:I have successfully managed to establish connection between the jboss(vm) and the window oracle db...this is the standalone.xml datasource snippet--->

jdbc:oracle:thin:@172.16.9.116:1521:ORCL
oracle.jdbc.OracleDriver
oracle

MEP_DEV_LINUX
MEP_DEV_LINUX

4:Issue!!! : I am failing to establish connection to the ms sql server from the jboss ... i have tried so many combinations and other desperate tweakings to the standalone datasource subsystem configurations but no success.

My sql ds configuration snippet-->

                <!--<connection-url>jdbc:sqlserver://172.16.9.116:1433/master</connection-url> -->
                <connection-url>jdbc:sqlserver://172.16.9.116:1433/master;databaseName=master;</connection-url>
                <!-- <connection-url>jdbc:microsoft:sqlserver://172.16.9.116/1433;DatabaseName=master</connection-url> -->
                <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                <driver>mssql</driver>
                <security>
                    <user-name>sa</user-name>
                    <password>ridiculus123</password>
                </security>

I am constantly getting this error--->
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused. 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.".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:206)
at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:257)
at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2385)
at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:567)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1955)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1616)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1447)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:788)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:719)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(SQLServerDataSource.java:79)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:314)
... 27 more

5: Its very importannt for me to inform that I am not getting any errors while testing the jboss in my windows. its all cool.

Please help guys...on edge here.

Responses