Reputation: 1
I have written an application in java Swing that runs in 8 machines under a Local Area Network and accesses a mysql db. The program is running fine. But, now my client has decided to set up a new branch at a distant location which should be connected to the existing branch. How can I modify/extend my application to handle that situation. client wants to use it in normal internet connection.any ideas will be great help.
Upvotes: 0
Views: 1054
Reputation: 128807
You should not connect directly from the Swing clients to the database. It's better if you implement a service to communicate with the database, and the Swing application communicate with the service.
The easiest thing may be to set up a web server, and communicate with JSON using an Apache HTTP Client in your Swing application. That is what I'm using.
In summary you need three parts:
As Ajay suggests, the deployment will be easier if you use Java Web Start.
Upvotes: 5
Reputation: 11875
Use Java Web Start. The client would download the jnlp file and open the GUI using that
Also have a clear separation between your view and model. Your client will talk to a service which can give you the data from the DB.
Upvotes: 1