• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting Applet to an Access Database

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic