Skip to content
Advertisement

How to send SQL queries to a computer outside of the network through port?

I have a java program that uses SQL queries. The goal is to send them from my home PC to a workstation on a different network elsewhere.
The SQL server is on Windows Server and I opened port 1433 for inbound connections. From that computer, I can successfully ping the port. However, I can’t ping the port from the public ip address, only the local (192.168…), so it doesn’t work if I were to try to ping it from my home computer.

Is there a way that I can ping it from my home computer? If so, how would I specify the address for JDBC?

Thanks!

Advertisement

Answer

It sounds like your Windows Server is behind an internet gateway/router. You need to configure the gateway to allow and forward inbound connections to TCP port 1433 to the IP of the computer that has SQL Server installed.

Here are some guides that explain how to enable port forwarding on different devices:

Also, note that we can ping IP addresses, not ports.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement