Error when connecting MSSQL server using JDBC Request
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?
Solved! Go to Solution.
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
Thank you for your reply.
I am using Windows Auth (JDBC driver). I have tried sql and win authentication,but none works.
The SQL server is hosted on a different machine and the server auth is set to SQL and Windows auth .
I know what mistake i did. In the Host name i didnt give the sql server name and was trying with localhost (which was wrong). Gave the sql server name and re-tried, but i get the below error. I have RWE access
If you can change to SQL auth, that'll save a lot of headache.
If not have a look at the following links where this issue was solved (albeit on older versions of sqlserver and readyapi!)