11 Replies Latest reply: Nov 19, 2007 6:06 AM by 807600 RSS

    Signed Applet Database Connection..

    807600
      it works in my Test HTML..
      <html>
      <head>
           <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
           <title>Java Applet</title>
      </head>
      <body>
           <p>Applet Test</p>
           <p>
                <applet code="Main.class" archive="flowchart.jar" width="90%" height="90%" alt="Sorry, you need Java to run this Applet">
                     <param name="Username" value="root" />
                     <param name="DatabaseType" value="MySQL" />
                     <param name="Database" value="OQMcontrolec30_validatie_mysql" />
                     <param name="Server" value="192.168.5.4" />
                     <param name="ProcesID" value="72" />
                </applet>
           </p>
      </body>
      </html>
      it doesn't work on the server..
      <body BOTTOMMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0 SCROLL=no>
      <APPLET code="Main.class" codebase="./" height="100%" width="100%" archive="flowchart.jar">
      <param name="Username" value="root" />
      <param name="DatabaseType" value="MySQL" />
      <param name="Database" value="OQMcontrolec30_validatie_mysql" />
      <param name="Server" value="192.168.5.4" />
      <param name="ProcesID" value="<?=$_GET['id']?>" />
      
      <br>
      Sorry, your browser doesn't support Java.
      <br>
      </APPLET>
      I get this for an error in Java Console (using firefox)
      jdbc:mysql://192.168.5.4:3306/OQMcontrolec30_validatie_mysql
      com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: 
      
      ** BEGIN NESTED EXCEPTION ** 
      
      java.net.SocketException
      MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.5.4:3306 connect,resolve)
      
      STACKTRACE:
      
      java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.5.4:3306 connect,resolve)
           at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
           at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:277)
           at com.mysql.jdbc.Connection.createNewIO(Connection.java:2668)
           at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
           at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:185)
           at Main.init(Main.java:200)
           at sun.applet.AppletPanel.run(AppletPanel.java:419)
           at java.lang.Thread.run(Thread.java:619)
      
      
      ** END NESTED EXCEPTION **
      
      
      
      Last packet sent to the server was 157 ms ago.
           at com.mysql.jdbc.Connection.createNewIO(Connection.java:2741)
           at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
           at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:185)
           at Main.init(Main.java:200)
           at sun.applet.AppletPanel.run(AppletPanel.java:419)
           at java.lang.Thread.run(Thread.java:619)
      and that sort of repeats itself on every query I do..
      now I've read around the forum that when calling an applet from javascript it isn't trusted.. even when it's signed
      this here is called with PHP.. and I think it isn't trusted either
      how do I make it trusted?

      Edited by: Nizzle on Nov 19, 2007 10:28 AM