Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

security issues with applet

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi gurus!
Can someone please tell me why I am getting this error.
I just compiled a java program, generated a .class and then tried to run an applet and then this error.

java.security.AccessControlException: access denied (java.lang.RuntimePermission
accessClassInPackage.sun.jdbc.odbc )
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:195)

How can I resolve it?,
Please help!
Thanks in advance



 
hi

looks like u've been trying to use jdbc in an applet. thats not possible bcoz the system security doesnt allow u to do so. it'll b possible only with servelets etc.

luv
Karthik.
 
Hi Karthik,

Don't applets allow jdbc requests to the server they came from? I have read somewhere that applets can read and write etc, to the host they came from.

Or can applets never use jdbc connections?

I'm doing research about logging data with the use of applets, but they don't same the perfect solution! Do you know what kind of techniques you can use to connect to a database?

Greetz, B2d
 
that is quite a surprise because all the research I have done so far on how to access the database with jdbc give almost the same connection mechanism.
How do you suggest that I connect to oracle with using jdbc?
Thanks
 
hi

applets can read and write to files. but when u try to read some file like autoexec.bat that throws security exception. to overcome this, u must have a digital signature for ur applet. there is a tool that comes along with java sdk that can generate signature keys for the applet. the whole set of classes u use must b put into a single jar file. these signatture keys are generated and added to the jar files. the system that sees this signature allows the files like autoexec.bat to b read without throwing exception. about databases i've not tried it myself but heard frm many sources that it throws exceptions too (for the same reason). i dunno whether the signed applet can connect to the database. anyway, the easiest way would b to use servelets as they connect easily without giving problems.

luv
Karthik.
Pearls and Diamonds are not found on surfaces.
 
if i figure it out or i find a workaround, i will post for eveyone else's benefit.
Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top