Hi guys!
I dont know if this is the right place where i have to post it! If it is not please let me know where I should post it....
I have a small problem using the applet with the driver mysql.
This is what i managed to do:
I have created a java program which is connected with a database mysql using the driver jdbc.
It works fine when i run the program from the netbeans tool.
Now I would like to create an applet and i have created this class:
import Webpages.InitialWebPage;
import java.awt.*;
import java.applet.*;
public class RunApplet extends Applet
{
InitialWebPage f;
public void init()
{
f = new InitialWebPage();
}
}
The class InitialWebPage is the one which contains the main method.
Then I have done:
<html>
<head>
<title></title>
</head>
<body>
This is an applet:<BR>
<applet code="RunApplet.class"
></APPLET>
</body>
</html>
I have put this file in the same folder of the file RunApplet.class
But I have received this exception:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)
I tried to resolve the first exception and I created a jar file: anto.jar which contains the RunApplet.class and mysql-connector-java-5.1.0-bin.jar
I modified the html code in this way :
<html>
<head>
<title></title>
</head>
<body>
Il seguente è un applet:<BR>
<applet archive="anto.jar" code="RunApplet.class">
</body>
</html>
But now I received this execption:
java.security.AccessControlException: access denied (java.util.PropertyPermission java.home read)
Please could someone help me to fix this problem? What I have to do to connect an applet with a mysql database?
thanks in advance
antonio

Reply With Quote

