Remote SQL Server Instance Connection using JDBC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday - last edited Thursday
Hi All,
I am connecting Remote SQL Server Instance using JDBC Driver, I have enabled TCP/IP and Setup the Firewall Rule. When i am querying the instance i am getting this error:
(com.microsoft.sqlserver.jdbc.SQLServerException) The TCP/IP connection to the host 192.168.x.x, port 1433 has failed. Error: "Connect timed out. 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."
Here is my code:
1. I am using ipv4 address of my personal computer as host, so is it correct?
2. If i am using the server name as host i am getting the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
192.168.x.x is a local ip address, it will not work in databricks notebook. First try to find your public ip address and try to connect through SQL Server management studio or .udl file. If it works, then you can use the same ip in notebook.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
I am able to connect using is ip address through another laptop where ssms is installed and i have tested the connection using udl file, i am able to connect. i think this is not the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Yes, that will work because you are on the same local network. To connect from the outside network, you have to use the public ip address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
If you want to access a local SQL server, you'll need a Private Link to access the server. If it's on your own local machine, that's likely not possible. Creating a VPN to your machine is a unique problem, and you would be better off using a VM or a PAAS SQL database as the source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday - last edited Friday
Thank You for the reply but the solution should be on-prem ssms or any other rdbms direct connection with azure databricks.

