Please, I want my java desktop application and php dynamic website to share the same online database. Especially a mysql database hosted online.
I want to embark on a project where I'd install my java desktop application on several systems and they can all access mysql database online.
The Java app would use the JDBC API, which comes with the JRE. The only thing you would need to ship with the app are the JDBC drivers for MySQL (which you can find here).
Joined: Mar 18, 2013
Hhmmn..Thank you so much. But I'm still not very clear. I have been using netbeans to connect my java desktop app to WAMP MySql database on localhost and now I want to connect to Wamp mySql on a web server (ie.hosted online, in a remote server). How can I do that please..How can I connect my java desktop app to my php website's online database in netbeans.
Joined: Mar 22, 2005
NetBeans is an IDE - it plays no role during runtime.
So you want to connect to a DB that's not somewhere on a local network, but somewhere across the internet? Then JDBC is generally discouraged due to security concerns.
Joined: Mar 18, 2013
So how can I go about it? Though I'm not so partcular about security for now because the contents of my online database will be uninteresting to a malicious user
Malicious users tend to hack or destroy things just for the fun of it. Be sure to have a tested backup process in place, and not to put sensitive (ie. personal) data in the database.
The proper way would be to set up an application server (placed behind a firewall). The desktop application would call the business logic stored on the application server (probably using webservices), and the app server would connect to the database. So there would not be a direct connection from the app to the database and the firewall would not allow connections to the DB from the internet. (The app server would also check the privileges of the current user on each call, so that an unauthorized person cannot circumvent these checks by calling the webservice directly.)
And since you'd have an application server, you could use WebStart to deploy the application, alleviating the need for a separate deployment process.