Forum Discussion

VishKini's avatar
VishKini
Occasional Contributor
5 years ago

Error when connecting MSSQL server using JDBC Request

Hello,

 

This is my first time trying to use a JDBC request to connect to SQL DB.When i am trying to connect i am getting an error as below.

 

Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 127.0.0.1, port xxxx 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.".

 

I have checked with my network team and there are no blocks reported.

 

Can anyone help me in resolving this error?

  • VishKini ,

     

    ok - first thing - I always have trouble connecting to SQLServer - whats the connection type you're using?  SQL? Mixed mode?  Windows Auth?  

     

    what driver - JNDI or JDBC?

     

    Try the SQL mode option - I couldnt connect with anything else when I last tried this.

     

    the exception indicates you are trying to connect to a SQLServer instance local to the machine that ReadyAPI! is running is - is that correct?  (due to 127.0.0.1) if thats the case - change authentication to SQL only - that works everytime as far as I can tell

     

    otherwise we're going to need your full logging (both ReadyAPI! and SQLServer) to try and sort this out  - but "connection refused" typically means a problem with your authentication/authorisation

     

    ta

     

    rich

  • richie's avatar
    richie
    Community Hero

    VishKini ,

     

    ok - first thing - I always have trouble connecting to SQLServer - whats the connection type you're using?  SQL? Mixed mode?  Windows Auth?  

     

    what driver - JNDI or JDBC?

     

    Try the SQL mode option - I couldnt connect with anything else when I last tried this.

     

    the exception indicates you are trying to connect to a SQLServer instance local to the machine that ReadyAPI! is running is - is that correct?  (due to 127.0.0.1) if thats the case - change authentication to SQL only - that works everytime as far as I can tell

     

    otherwise we're going to need your full logging (both ReadyAPI! and SQLServer) to try and sort this out  - but "connection refused" typically means a problem with your authentication/authorisation

     

    ta

     

    rich