How to solve Java Applet Security Problem
When you make a new Java-applet which connects another DB Server, it won't work in Linux or Mac System. This is due to "permission", thus you need to sign your applet first.
see this.
keytool -genkey -keystore myKeyStore -alias me
keytool -selfcert -keystore myKeyStore -alias me
jarsigner -keystore myKeyStore jarfile.jar me
http://www.doc.ic.ac.uk/csg/faqs/java/signed-applets.html
after this work done, you need to modify your applet code as follows
see this.
keytool -genkey -keystore myKeyStore -alias me
keytool -selfcert -keystore myKeyStore -alias me
jarsigner -keystore myKeyStore jarfile.jar me
http://www.doc.ic.ac.uk/csg/faqs/java/signed-applets.html
after this work done, you need to modify your applet code as follows
SecurityManager oldSecurityManager = System.getSecurityManager() ;
SecurityManager newSecurityManager = new SecurityManager()
{
public void checkConnect(String host, int port) {}
public void checkConnect(String host, int port, Object context) {}
};
try
{
System.setSecurityManager(newSecurityManager) ;
...
DriverManager.getConnection(...) ;
}
finally
{
System.setSecurityManager(oldSecurityManager) ;
}
