Connecting a Java Desktop Application to Remote MySQL Instance
I am writing a Java application to access values in a remote MySQL instance. Everything I have read about connecting to the DB has been using "localhost" through JDBC in the URL. A tutorial I read said that the IP address can be used instead leading me to wonder if I could use the IP address to access a remote server.
The Setup:
1. Java Application on a Mac sending queries and changes for and to the DB values.
2. MySQL instance running on a separate computer (a laptop for now as this is an at home project).
3. The two computers will be on the same network when queries will be tested from the Java application. A second LAN within the house will make the connection for the two devices.
Main questions:
1. Are there differences between connecting to the server from within the LAN when compared to accessing a server over a LAN-WAN-LAN type of connection? If so, what are they?
2. Will putting in the IP for the server device instead of "localhost" work when the two devices are connected to the same LAN? Logic tells me it will but there is much I don't know about networking and application networking.
Subject
Written By
Posted
Connecting a Java Desktop Application to Remote MySQL Instance
November 01, 2019 01:44PM
November 02, 2019 07:03PM
November 04, 2019 06:07AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.