the applet(which make connection to access database) i developed is working fine in applet viewer, but when embedded in an html file, it cannot access the database. how can i rectify it?
2 Answers
An applet lives in a security sandbox. In order for you to do file io, your applet jar(s) need to be signed.
Comments
Applets respect same origin policy. It cannot connect to any other sever other than where it is hosted. You database and your webserver needs to be on same ip.
1 Comment
Andrew Thompson
It seems as though the JRE does not consider it to be the same site though. One typical case is where a non-relative URL is used to connect to the DB. E.G. A page at D:where/my/server/is/WEB-INF/applet/db-applet.html could not connect to 127.0.0.1:8080/db. The applet would need to come from 127.0.0.1:8080/applet/db-applet.html to make that work in a sand-box.