• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Connecting to a local (microsoft) database, best approach?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a microsoft database, however I can't connect to it directly through the internet - only locally, but I need to access it from an applet. So I was just wondering what kind of approach you guys would suggest to accomplish this? The microsoft database have to stay the way it is because it's administrated by a C# program, so the approach have to involve some way of contacting the database and passing on the result (true/false).

The interaction with the microsoft database is really simple, it's just a basic authentication (checking username/password) before the user is allowed to use the rest of the applet (connecting to a mysql database).

My first thought was using an application server (glassfish), but that approach seems way too involved and complicated to solve such a simple task.

Thanks in advance!
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create a DSN, use JDBC-ODBC driver to connect to the MS Database and use JDBC API to do the needful.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are launching your Applet from a Servlet engine such as Tomcat or Jetty then my approach would be to have one or more Servlets that perform ALL database access and have your Applet invoke the Servlets using a very restrictive set of actions when they need to read or write data.

There are some security advantages to using this approach. Each client can be made to log on (user name and password may be enough) and then there is no way for anybody to access the database directly; the database password is never exposed outside the Servlet and, if using HTTP or HTTPS (the preferred approach), there will be no firewall problems.
 
Tom Sakra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

James Sabre wrote:If you are launching your Applet from a Servlet engine such as Tomcat or Jetty then my approach would be to have one or more Servlets that perform ALL database access and have your Applet invoke the Servlets using a very restrictive set of actions when they need to read or write data.

There are some security advantages to using this approach. Each client can be made to log on (user name and password may be enough) and then there is no way for anybody to access the database directly; the database password is never exposed outside the Servlet and, if using HTTP or HTTPS (the preferred approach), there will be no firewall problems.



Thanks for the solution, this seems like the way to go!
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic