• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting Applet to an Access Database

 
Sumit Mhatre
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a beginner in Java. I'm creating a web based application. I've created an applet. I want to connect it to my Access database using pure jdbc drivers. I'How do I do this ? Any suggestion / code in detail plz...
[ July 28, 2005: Message edited by: Sumit Mhatre ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets can only connect to the server they were served from, so that's where your database must live (unless the applet is signed, in which case it can connect to any host).
The web/DB server must be configured so that the DB port is open to the outside world (unless you're planning on tunnelling the DB traffic through a servlet on port 80 somehow).
An applet being a web app, it can potentially be run by many people simultaneously - not something Access is good at, especially if you'll be using the JDBC/ODBC bridge as driver. But you mention a pure JDBC driver, so that's probably not an issue. But Access itself is not good at concurrent use.
Those are the points that come to mind off the top of my head. For starters, it's probably easier to write an application to do that, and then convert that to an applet later, once all the DB stuff works.
[ July 27, 2005: Message edited by: Ulf Dittmer ]
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Ulf, but would add that one technique would be to use RMI. You can go back to your same host (unsigned), or to a different host (signed). But you do have concurrency issues; everyone uses the same remote object.
 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dale Seng:
I agree with Ulf, but would add that one technique would be to use RMI. You can go back to your same host (unsigned), or to a different host (signed). But you do have concurrency issues; everyone uses the same remote object.


so what are u saying ..we can't make concurrent connection when using rmi ?
pls tell me what is signed/unsigned host ?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

pls tell me what is signed/unsigned host ?


It's not the host that is signed, it's the applet. Signed means a digital certificate has been applied to the applet code which ascertains that the applet code has not been tampered with. It also tells you who originally wrote the applet; you can then coose to trust that persons code or not. (I'm simplifying tremendously here for the sake of brevity).
An unsigned applet operates within a "sandbox" in the browser, where a number of operations are not allowed, such as file I/O and network connections to a host different than the one where the applet was served from. That's why, if an unsigned applet wants to make a DB connection, the DB needs to be on the same machine as the web server.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to basic network restrictions, JDBC itself has sandbox limitations for applets, so only a signed applet will work.

In general, if you thing you need a signed applet, it's an indication that you're trying to do things the Wrong Way.

What you are doing is attempting to create a 2-tier application. That's not a good idea for many reasons, the most infamous of which was exemplified by the SQL Slammer worm. While it's a lot more work to build a 3-tier app, you insulate your DBMS from external attackers by doing so.

Also, note that neither MS Access nor MS FoxPro are designed to work in a multi-user concurrent access environment and can easily become hopelessly corrupted if the attempt is made. For a web app, you're better off using SQL server, Oracle, DB2, MySQL, PostgreSQL or any of a host of other multi-user DBMS's that have good JDBC support.

Also, the correct English spellings are "please" and "you".
[ August 11, 2005: Message edited by: Tim Holloway ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic