• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

database programming

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 80735
485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic