Signed Applet Database Connection..

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

sabre150 wrote:
Nizzle wrote:
Yes =)
I'm pretty sure it has something to do with the applet being "Self-Signed"I don't think so. I use "Self-Signing" without problems like this.it seems that I have a .java.policy file in my userfolder..
which granted permissions for me on local applet test stuff..
so now I've removed that the signed doesn't do anything.. anywhere =(
I signed it like this:
keytool -genkeypair -dname "cn=TAG Software, ou=TAG Software, o=TAG Software, c=NL" -alias business -keypass w8woord135 -keystore /home/niels/TAGkeystore -storepass w8woord -validity 365
jarsigner -keystore TAGkeystore -storepass w8woord -keypass w8woord135 flowchart.jar business

Similar Messages

  • Not Signed Applets can connect to another machine?

    hi, guys,
    I developed a java applet, which will connect to different machine.so the local machine will grant the applet some permissions.
    I did not use signed applet and want to make thing easier.
    In the policy file: I add
    grand {permission java.security.AllPermission };
    It works.
    but when I want to change to:
    grand codebase "http://www.xxx.com" {permission java.security.AllPermission};
    It does not work.
    Can anybody help me to solve this problme?
    Great thanks

    grant,not grand
    Also include the ipaddress, like 234.56.78.89 of www.xx.com

  • Applet database connection

    I've written an applet that connects to a MS Access database. This applet works fine when run in Appletviewer (with the policy file included). The problem is when I try to run it in a Browser the applet is "not initialized" Can anyone suggest a solution. The point of this applet is to be placed on a web page and it will access the database on the same server. The applet will never have to talk to the machnine it's being run on. Thanks in advance

    I just checked the error message in the Java Console and I get the following message.
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc) at java.security.AccessControlContext.checkPermission(Unknown Source)
    the applet simply looks in the database and outputs some text to the browser based on what's in the database. It write nothing to the server or anywhere else. I set up the permissions via a policy file. Is there a way to allow the browser to access the policy file??
    for instance in appletviewer I can provide the following
    appletviewer -J-Djava.security.policy=policyfile page.htm
    where policyfile is the policy file with the appropriate permissions. How can I get the webbrowser to access this file???
    thanks again

  • Applet database connection : access denied

    Connections to my MySql database can only made from applications running on the host. So when I log on to my domain and run a Java application from the console, I can talk to the database. There's no problem with php either. But when I upload an applet, I get an access denied.
    Anyone knows how to get around this problem?

    Change MySQL so that it will accept connections from users running on whatever system the applet is running on.

  • Applet Database Connectivity

    I m trying following code to connect Database within Myapplet
    but class.forName is throwing exception???
    Any idea to remove this problem???
    import java.applet.*;
    import java.awt.*;
    import java.sql.*;
    public class Myapplet extends Applet {
    int width, height;
    Connection con;
    Statement st;
    ResultSet rs;
    public void init() {
    width = getSize().width;
    height = getSize().height;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:abc","","");
    st=con.createStatement();
    catch(Exception e)
    //out.println("some problem");
    public void paint( Graphics g )
    }

    You must first check that driver you are using to connect with DB is placed in your class path.
    If driver is not found then Class.forName(); throws exception.

  • Cannot connect to database in a signed applet

    Hi i have an applet that connects to a database and does stuff. However when I move the applet to a different server i get errors. I did sign the applet but i still get
    java.security.AccessControlException: access denied (java.net.SocketPermission <server> resolve)
    Do I have to explicitly allow the applet to open a socket to this server, do I have to set up policy files and how exactly is this done? Please explain in detail
    Thanks

    First, don't use applets to connect to the database directly.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file using doprivileged
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • Database connection an applet

    Hi, I want to do an applet where I can connect to a SQL server via an ODBC. The whole conencting to the database works fine with an application, but access is denied when I use an applet ( ie. I have a separated class that do the databases connections and it failed when I use an applet).
    Somebody told me that I have to create a java.policy file for users and signed the applet with .jar. but I'm not familiar with either signing a jar(I'm not familiar with the .jar at all) and I'm not familiar either with the java.policy file. Can anyone explain this to me plz?

    signed the applet with .jar. but I'm not familiar with either signing a jar(I'm not familiar with the .jar at all)So...., check out the link shown below.
    http://developer.java.sun.com/developer/qow/archive/167/index.jsp
    ;o)
    V.V.
    PS: remember me?

  • Can signed applet taked to database directly

    Hi All,
    I have a signed applet download from the web server. It works well to write files to client machine.
    My question is that can this applet talk to database which the ip address is different with the web server.
    Thanks
    Scott

    I am trying to connect to an Access database from a signed applet. Both the applet and database are in the local machine. I am getting an exception from the security manager. Do you know how can I get permission from the security manager for my applet to access the database ?
    Thanks

  • Database Connection through Applet

    Hello All,
    I want to connect to Access Database through Applet. But I am getting access denied error. How to allow an Applet to connect to the database ?.
    Waiting for reply.
    Thanks and regards,
    Sachin

    I believe it's possible to change the security policy for the java plugin that runs applets, (though I haven't found an appropriate policy file). However, there seems little point in writing an applet that requires that. The whole point of applets is that anyone can run your applets over the net without any special installation. If whoever is going to run your applet has to muck about with security policy files, they'd be a lot better off just running a stand-alone GUI program.
    Even if you signed the applet there would still be the problems associated with having the access file in the right place on the client machine.
    In short you're falling between two stools. Either make the thing a standalone Swing program and install it alongside the database it accesses or do the database access in a web server environment and have the client side obtain the data from the database through http access.

  • Signed Applet able to connect to distant webservice?

    Hello :)
    I was wondering if an applet would be able to connect to a web service located on a distant server (Axis 1.3). I have signed the applet but it still doesn't work...
    Architecture:
    Signed Applet >> Axis 1.3 web service >> MySQL requests
    Is it possible without editing the java.policy file on each client machine?
    If the answer is no, would it be better to change my architecture by the following one ? :
    Signed Applet >> Servlet >> Axis 1.3 web service >> MySQL requests
    Thanks in advance for your help!
    Bye

    I'll try to explain a bit more what i am doing out there. It's just a test applet to gather information with forms. When the user is done filling the forms, he clic send.
    The applet connects to an axis web service which connects to a MySQL databases and create the user account with the user informations filled in the applet.
    Tell me if you need to know more about it. Here is the exception:
    Exception in thread "AWT-EventQueue-2" java.lang.ExceptionInInitializerError
         at org.apache.commons.discovery.jdk.JDKHooks.<clinit>(JDKHooks.java:75)
         at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:412)
         at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
         at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
         at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
         at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
         at org.apache.axis.client.Service.getAxisClient(Service.java:103)
         at org.apache.axis.client.Service.<init>(Service.java:112)
         at creation.CreationCompte.ok_actionPerformed(CreationCompte.java:131)
         at creation.CreationCompte$CreationCompte_ok_actionAdapter.actionPerformed(CreationCompte.java:338)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkCreateClassLoader(Unknown Source)
         at java.lang.ClassLoader.<init>(Unknown Source)
         at org.apache.commons.discovery.jdk.PsuedoSystemClassLoader.<init>(PsuedoSystemClassLoader.java:73)
         at org.apache.commons.discovery.jdk.JDK12Hooks.findSystemClassLoader(JDK12Hooks.java:215)
         at org.apache.commons.discovery.jdk.JDK12Hooks.<clinit>(JDK12Hooks.java:73)
         ... 35 more

  • Database connection in applet works in Netscape but not in IE

    Hello,
    we have an applet which connects through an jdbc:odbc connection to an Access database.
    When we run it in Netscape 4.7, the applet connects to the database and finds records. When we run it in IE (5.5), we get an error.
    Haven't completely figured out where, but most likely when we try to get the connection:
    con = DriverManager.getConnection(url, "loginname", "password");
    We end up in the catch block.
    Any suggestions what the problem could be?
    TIA
    Gunter

    Can u send me code and let me see.
    Tell me all specification which Access driver you are using and which DSN you are using.
    Let me know i know i can help u out.

  • Signed applet, jmf.jar provided, but no connection

    hi there!
    i'm posting this again in order for you to earn duke-bucks.
    i have a similar problem. i wrote an applet that connects to a video-streamserver an requests a live-stream. the applet sends some udp-packets to the server, which retreives the client's ip from the
    packet and sends it back to the client ( i did this to avoid signing the applet, since otherwise the client
    would have to do a dns-lookup and therefore be signed). the client gets back his public ip (i don't have the 127.0.0.1-problem) , however, i get an
    InvalidSessionAddressException :
    Local Data Address Does not belong to any of the local interfaces
    it seems, the client cannot recognize it's own public ip.
    so i thought, signing the applet would do, but it doesn't.
    I get the same InvalidSessionAddressException.
    now, this only happens on hosts on which jmf is NOT installed.
    Installing the jmf solves the problem. but i don't want people who visit my page having to install
    jmf in order to watch my livestream. i tried including the whole jmf.jar (also tried, customizing it),
    but no success.
    i read the posts on the issue: running jmf-applets on non-jmf-systems, but there seems to be a
    controversy on wether that is possible or not. some say, jmf must be installed, some say, just include jmf.jar or customized jmf.jar.
    what else could i try? i have the clients public ip and i have the applet signed. so, there shouldn't be
    any restrictions anymore.
    i have no ClassDefNotFoundExceptions, so i suppose, including jmf.jar works.
    what else gets changed when i install jmf? there must be some restrictions that keep the vm from
    determining the hosts public ip and which will be removed by the installation of jmf.
    anyone had similar problems? and, perhaps, a solution to this?
    thanks in advance,
    honfrek
    b.t.w. you can earn some duke-bucks too !

    hi!
    i found a very elaborate solution here:
    http://www.mutong.com/fischer/java/usbcam/VideoToAppletWithNoSupport.zip
    this link has been posted before,
    http://onesearch.sun.com/ClickThru?qt=servlets&url=http%3A%2F%2Fforum.java.sun.com%2Fthread.jsp%3Fforum%3D28%26thread%3D515345&pathInfo=%2Fsearch%2Fdevelopers%2Findex.jsp&hitNum=45&col=devforums
    this solution uses jmf only on server side for capturing, then converts the capture-stream into images, splits
    the images into smaller regions and evaluates the differences of these regions to the regions of the previous image. if the difference hits a certain threshold, these regions are transmitted to the applet. but the transmission is done via tcp, which slows things down.
    the splitting -code is hard for me to understand, since i'm new to java.

  • How do I get an applet to connect to a database?

    1) I'm working inside a firewall, so only people in my company can see the web server and database server.
    2) My web server has a security certificate installed and SSL is enabled
    3) My java code works fine as an application.
    4) How do I modify my code, my JAR file, my HTML page, or something to get my applet to use the Security Certificate and not throw java.security.AccessControlException?

    tlaford wrote:
    Thank you for your reply.
    1) By a lucky coincidence my database server and my web server are indeed the same machine.Then it should work.
    What that means is that the 'name' you are using for the database does not match the 'name' used for the url requesting the applet.
    The specifics of that are based on what names you are using - and are outside of what I know. However there is some way to get the origination source of the applet. You can either then use that name or at least compare the two (that and your database connect string) to see the difference.

  • Calling one applet from another passing database connection

    We are trying to establish if it is possible to start an applet that connects to a database and use that as a 'menu'. From there we would call other applets. Is there a way to pass along the database connection from one applet to another. Any help is greatly appreciated.
    null

    Here' s a sample program in the Java Tutorial that messages between applets.
    http://java.sun.com/docs/books/tutorial/applet/appletsonly/iac.html

  • How to get database connection in applet

    Hi,
    I am trying to prepare database connection in applet. After preparing connection with database it'll read same values from table.
    At the time of development it works fine. I have used esclipse IDE for coding and testing.
    But when I try to call that applet from browser. It is giving ClassNotFound exception.
    Does anybody know How to get database connection in applet ?
    Please help me if anybody know solution for this.
    Thanks,
    Rajesh

    As per my knowledge is conserned
    1 u can get the database connection in a jsp page and u send the result set as param to the applet and u can use retrieved values as if they were of the same applet if u r interested i can send the db connetion coding for jsp my id [email protected]

Maybe you are looking for

  • PDF password

    I know i must be thick, but can anyone out there in the real world please tell my how on god's earth do i find a stupid PDF password so i can open a simple file that after 3 months of trying it MAY! be able to assist me in doing the most simplest of

  • Error deleting source system with error message: "incorrect input for....."

    Hi, I'm trying to delete the source system using tcode RSA1 => Source systems => select the 'source system' and delete, but I got an error message as follows: "incorrect input for activating transported shadow IPacks" Fyi, I have opened up the client

  • Error in calling up application Appraisal document

    Good Morning. We are implementing Appraisals for ESS and MSS with BP 1.41. We are working ECC 604. We are following the information of help.sap for configure this component. We did the following setting in the customizing.   1.      In Customizing, c

  • Planning user issue

    hi i have created a user with administrator access through planning web...and i have tried to open securities in Essbase(back end)with that Users.... its showing only my user name with type of User is "User" not "Administrator".....please suggest...m

  • Why does my MacBook pro keep beeping 3 times. The screen is frozen.

    Like my MacBook Pro keeps beeping 3 times and pausing for 2 seconds. The screen is frozen.  How do I fix this and what is going on?