File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Connecting between Applet and database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Connecting between Applet and database" Watch "Connecting between Applet and database" New topic
Author

Connecting between Applet and database

hasan wasif2k1
Greenhorn

Joined: Jan 13, 2001
Posts: 26
Can we connect applet to database ?. If not kindly also mention the reason.
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91
Originally posted by hasan wasif2k1:
Can we connect applet to database ?. If not kindly also mention the reason.

Applets can be connected to local databases with permisions set properly and remotely with 3rd party software ($).
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
Applets can connect to database same as applications but with a few restrictions:
1. Applet can always connect to database server that is running on the same machine as the web server where applet is located.
2. Applet can connect to any database that is specified in security.policy file.
3. Applet can be signed to allow it access to database.
It is not always necessary to spend money to get appropriate drivers. Many are available for free.
hasan wasif2k1
Greenhorn

Joined: Jan 13, 2001
Posts: 26
What is the threat to Java security if permisions are not set and how that threat is avoided using 3rd party software ???
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91

Hasan,
The security hole is that your applet would be trying to access a database on the remote computer. If the remote computer trusts your applet (as in 2, or 3 from Aleksey's email). Then you are okay. Otherwise, the computer owner might not want you reading their databases.
Aleksey, how can i conect to databases on my server without buying a driver? (As in, where who has a free driver).
hasan wasif2k1
Greenhorn

Joined: Jan 13, 2001
Posts: 26
Dear Mr Bailey,
If applet can make connection from the server it is downloaded then why can't it access database of that server from where it is downloaded ???.
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91
You will need a database server that the applet can connect to, then the applet _can_ connect to the server from which it was downloaded.
Paul
Mostafa Al-Mallawani
Greenhorn

Joined: Sep 22, 2001
Posts: 1
how do i changed the security.policy file? and what do i change in it?
Originally posted by Aleksey Matiychenko:
Applets can connect to database same as applications but with a few restrictions:
1. Applet can always connect to database server that is running on the same machine as the web server where applet is located.
2. Applet can connect to any database that is specified in security.policy file.
3. Applet can be signed to allow it access to database.
It is not always necessary to spend money to get appropriate drivers. Many are available for free.

Ken Hutchinson
Greenhorn

Joined: Jan 23, 2002
Posts: 4
Could you please increase the "granularity"? I am new to the issues involved in writing applets and have no idea how to get an applet to access a remote database. I am using MS Access by the way.
My applet is running on Tomcat and the DB is just an mdb file.
I hate to ask, but I need a step by step explanation on how to resolve this. If there a resource you can point me to, please let me know.
Thanks in advance!
kh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting between Applet and database
 
Similar Threads
appletJdbcconnection
URGENT !! JDBC and applets
Applets and JDBC
JApplet in Browser : Connection Problem
Applet to Database connection