Connecting to a local (microsoft) database, best approach?
Tom Sakra
Greenhorn
Joined: Oct 09, 2010
Posts: 8
posted
0
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.
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.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Tom Sakra
Greenhorn
Joined: Oct 09, 2010
Posts: 8
posted
0
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!
subject: Connecting to a local (microsoft) database, best approach?