Link to home
Start Free TrialLog in
Avatar of thembie
thembie

asked on

java database applet connectivity

i want to use a java applet/servlet for user aunthentication for an online application that i'm developing.the applet connects to an MS Access database So i want the applet to verify the details entered by the user ny comparing with some values st
Avatar of heyhey_
heyhey_

what's the problem ?
Avatar of thembie

ASKER

no the problem is i'm failing to connect the applet to the database and i'm getiing datasource not found error.i've set up the drivers correctly but still getting the same error
post the full exception stacktrace.
"the problem is i'm failing to connect the applet to the database and i'm getiing datasource not found
error.i've set up the drivers correctly but still getting the same error" - to what datasource are you connecting? Is local datasource accesed with odbc or remote server? Do you have raised sequrity exception or db connect exception?
Thembie.
If you are trying to connect to database from applet. Then you need to been signed applet or the database and web server should be in the same database.
Datasource is the Client dependent stuff. I don't think it is possible to connect applet using DSN. DSN is client side piece of information. So u need to use to use Type3 or Type 4 drivers.
Type 1 and Type 2 are client dependent.

Shyam
Access database is a 'desktop' database, ie not distributed. accessing an access db over a network is done thru the windows file-sharing system. an applet trying to use an access db is thus subject to two levels of security checks.
1) Applet security (has to be signed to access filesystem)
2) Windows security (machine running applet has to have access to machine hosting access db thru windows filesharing)

I'd suggest that if you intend your applet to acces your db you choose a true RDBMS (where the client can connect to the db thru TCP/IP directly via an appropriate JDBC driver), like Oracle or SQL-server. If you are not keen on paying there are free alternatives like MySQL or Postgress.

If you are forced to use an Access db, i'd try and use servlets for all your db-dependant logic, since you can host both the db and the servlet engine on the same machine, thereby removing the depenancy on remote connectability.

PAP
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ'd and pts removed
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial