简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM