• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database programming

 
Tosin Michael
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Tosin Michael
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tosin Michael
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49849
70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Winston Gutkowski
Bartender
Pie
Posts: 10509
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Vajsar wrote:Malicious users tend to hack or destroy things just for the fun of it...

<nitpick>
Those nefarious bottom-feeders are actually called 'crackers'. Hackers are the good guys.
</nitpick>

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic