Applet & Database

ho un problema con un'applet java che si connette ad un database di Access 2000.
L'applet visualizza gli oggetti grafici e li popola con i dati letti dal database, quando la eseguo dal mio compilatore (JBuilder, JDeveloper); ma quando la eseguo all'interno di Internet Explorer, visualizza gli oggetti grafici ma non riesce a leggere i dati dal database. Perch�???
per connettermi al database ho creato una configurazione ODBC che ho chiamato "Dungeon".

Potete tradurre questo qui:
http://babelfish.altavista.com/tr
JBuilder and JDeveloper use special policys when executing the applet.
Sign the applet and make sure the jdbc jars can be found.
http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
second post
A full trace might help you out as well.
To turn the full trace on (windows) you can start the java console, to be found here:
C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
In the advanced tab you can fill in something for runtime parameters fill in this:
-Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
if you cannot start the java console check here:
C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
I think for linux this is somewhere in youruserdir/java (hidden directory)
add or change the following line:
javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
for 1.5:
deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
The trace is here:
C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
I think for linux this is somewhere in youruserdir/java (hidden directory)

Similar Messages

  • 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

  • Internet Applet database access

    Hi,
    - Howto connect an internet-applet to a database?
    + I am thinking about using a 3 tier:
    applet <---> (http port 80) <--->- appserver <---- (JDBC) ----> DB
    + on the web only port 80 I consider as available.
    + I could write a dedicated servlet which performs the DB-queries and sends the results back to the applet (for example by means of object-serializing OR flat text)
    ? Can it be done by means of SOAP/XML? is it fast enough? implementation tips?
    ? Can I use this construct also in a Swing app? (on the local network)
    ? Other suggestions?
    Thanks!
    Regards
    Stephan

    Hi,
    Sure web services can be used here.
    But to me it is not the most obvious solution in this case, based on what I've read (and build) on web services. Web services are generally used to leverage an open communication between heterogeneous applications, mostly on different sites/locations, i.e. applications that are loosely connected with each other and applications of different origin. An analogy: you would not use a database link to communicate between 2 schemas on the same database, you would use a database link between 2 different databases.
    This situation does not occur here because the given application is a client intranet application talking to a local database. That's why I mentioned webforms, but a JClient application would an obvious option either.
    I am not opting that you use webforms, I was giving alternative option ;-)
    Stephan, to answer to your question:
    --> But, how do you build such a meganism? Are there pre-defined servlet's available for sending objects? or frameworks?
    Apache Struts (or JSF).
    Kind Regards,

  • 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 communication thro' browser

    I want to know how to communicate applet with database using Internet Explorer Browser. We can communicate applet with database using appletviewer. But in IE it is showing "sun.jdbc.odbc.JdbcOdbcDriver not found" Exception. For that I took the sun.jdbc.odbc.JdbcOdbcDriver class from jdk, made it as a jar. I added the jar to the archive attribute of the applet tag. After that browser is showing suitable driver not found excption. How can I solve this problem? Please Help me.

    Hi,
    Microsoft changed the name of the JBDC driver.In order to get it
    to work for IE you will need to change the name of the driver to
    com.ms.jdbc.odbc.JdbcOdbcDriver.
    Alternatively, you can install the Java 2 plugin for your browser.
    HTML Converter will generate the .html to use the Java 2 plugin.
    See the following for more information about the HTML for using the Java 2 plugin:
    http://java.sun.com/products/plugin/index-1.4.html and
    http://java.sun.com/products/plugin/1.3/features.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • 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.

  • Applet database access problems!

    Hi,
    I have a major problem. I'm trying to design an applet that can talk to a database server which is not the same server where the applet is hosted. I keep getting an exception like below: (note I changed my db server name)
    java.sql.SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.net.SocketPermission aaaa.bbbbb.net resolve)
         at com.mysql.jdbc.Connection.createNewIO(Connection.
    help?

    Ok, I went back and re-read the answer to a similar question I asked earlier. Since I can't talk directly to the other db server, what is the work around?
    Make a php page that updates the database, then call that page from within the applet?

  • Applet Database Proxy Problem

    Hello all,
    I have an applet which connects to a MySQL database for user authentication. Currently I am doing on a local machine and all goes well and fine. But my problem is the same applet when accessed through a proxy the database connection wont happen. Can someone suggest a way to solve it. Or this problem is not solvable.
    Thank you
    joseph

    Use http to do the authentication. Have the applet make a request to the authentication server by name (not by codebase, as this is probably the source of the proxy problem). On the authentication server, you can run a servlet or cgi or whatever to contact the db.

  • Applets + Databases

    Is it possible to build an applet for a web page on an intranet to access a database server across the network

    Hi!
    Plz read about applet security and security in general before U start to editing your security policy files.
    Search and check out the topis "applet security", "security policy" on this site before continuing... it is hard to just tell U about it in one or two sentences.
    /Andrew

  • Applets, databases, policies, signing, etc...

    Hello,
    Well, I am deploying an applet application which needs to connect with a postgres database.
    I put my application in my hosting then I changed my local java.policy file adding a line as
    permission java.net.SocketPermission "127.0.0.1:5432", "connect,resolve";And my applet works... but I don't want that the user needs to change his policies file.
    I read in somewhere in the forum if the applet is signed the user doesn't need to change anything... then I sign the applet. But it doesn't work. It looks to me that signing the applet is not enough to allows the connection.
    But I don't sure.
    Some body had had the same problem or am I doing some thing wrong?? Other Ideas
    By the way, sorry for my bad english, I hope you can understand what I am saying.
    Bye, and thanks by advance

    The standard AccessControlException:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.ClassLoader.getParent(ClassLoader.java:701)
    Or something like that.
    That's what I'm trying to solve, I wish to use the Java Security Policy system to allow my applet access to various resources, such as writing files. Now I've seen that signing an applet will give it full access (in my view, this is rather insecure, but anyway), however following the steps to sign an applet two or three times has still presented me with the same problem. The signing is ignored, and the exception is thrown.
    Applet signing aside, I fail to see any documentation stating how the policy file is used by the VM when running on a browser. I assumed it might be an entry in the Jar's manifest file, but again, I can find no documentation.
    It's all very annoying, and Sun have done quite a bad job at documenting this. For example, their example talkes about -D-Jjava.security.policy=.... being passed to appletviewer. Who on earth uses appletviewer! If policies only work with that, then they are useless. I want them to work with whatever browser the applet is being run within.
    Surely this isn't too much to ask? :)

  • Applet security problems while connecting with database

    i hav problem in the japplet connecting with sql database
    it gives security access denied error while running program as my driver is jdbc:odbc:bridge driver
    so for resolving this error how can i turn off security of applet and also which security permission to be change?
    plz reply

    baftos wrote:
    Maybe I should question the need to access a local database on the client PC.
    But anyway, the normal way to obtain security clearance is to use a signed applet.
    Another possibility is to grant the applet all permissions by modifying the security policy file of each client to grant your applet 'all permissions'. Note that in this case you must have access to each and every client PC or ask them to do so before running the applet.Database access at client's machine is ridiculous. I doubt this is what OP wants.
    @OP: request you to post the original security issue and the environment details.
    Thanks,
    Mrityunjoy

  • Applet does not get client certificate from browser (Firefox, IE7)

    I'm writing a web service which runs Tomcat through Apache. One critical requirement is that the service be able to invoke certain device drivers on the end user's machine. Fortunately, there is a Java API for this, so this requirement can be fulfilled using an applet.
    Here's the problem. This is a B2B application, so we're using SSL and requiring client authentication. I'm no web security guru, but I managed to get SSL set up through Apache (with a self-signed certificate for now; we'll get a real one from a real CA when we're ready to go to production). I also managed to set up client authentication by creating my own CA and generating a client certificate, which I then copied to my test client (Win XPSP2) and imported into both Firefox (2.0.0.15) and IE (6.0.2900). The applet is signed with a real certificate, and that causes no problems. And all of the pages for my web service work as expected.
    All except one. The page which is supposed to load the applet pops a dialog stating 'Identification required. Please select certificate to be used for authentication', and presents a list of zero certificates.
    Actually, I get this dialog in Firefox on my XPSP2 box, and also when I test on a Vista Home Premium box running IE 7.0.6000. Puzzlingly, this behavior does NOT occur on my XPSP2 box when running through IE 6.0. It seems that with XPSP2 and IE 6.0, the JVM can manage to obtain the required client certificate from the browser and pass it along to Apache, but the JVM can't do this when running in Firefox or in IE 7.0 on Vista.
    I have gone to the Java Control Panel and verified that the 'Use certificates and keys in browser keystore' option is selected on both boxes.
    I've done a fair amount of research for this (including in this forum) and see that this appears to be a chronic difficulty with applets. What makes it worse is that I don't think I can use the standard workaround, which is to download the applet from a different host/virtual host, because the applet needs to communicate with the web service. Since we have the additional layer of Tomcat container-managed user authentication, the applet needs to be communicating with the server using the same session token as everything else.
    So at this point, I'm stuck. Does anyone know a solution to this problem? Two thoughts (I'm reaching at straws here):
    1) I have the certificate imported in both Firefox and IE as a 'personal' certificate. Is there someplace else I can put it so the JVM will know how to find it? A rather old thread in this forum mentioned something about setting properties in the Java Control Panel, but I see no place in the JCP to specify such properties, so I'm guessing that solution is no longer operative.
    2) I'm using a trick I found on the internet to make the applet load cleanly with both Firefox and IE, namely, I'm using the <OBJECT> tag to specify the applet class and codebase for IE, and then using <COMMENT><EMBED ... /></COMMENT> within the <OBJECT> declaration to specify the information for Firefox. Is there some other way of doing the markup that will give the JVM a hint that it should get a certificate from the browser?
    BTW . . . I would hate to drop support for Firefox, but if someone has an IE-only solution, I'll take it. Unfortunately, I reckon a Firefox-only solution would not fly.
    Thanks all.

    My applet is also signed by a valid certificate. The question of whether the applet is signed/self-signed/unsigned >isn't an issue --- I just wanted you to make sure the Applet runs because it is a know valid Java2 Applet that is 100% signed properly and verified to run.
    This eliminates the possibility that it is a JVM issue. However after reading your message further I am afraid
    it is not relevant to your issue.
    due to the client authentication, my browser (Firefox, IE7) refuses to even download the applet.
    I went to your site, and I can see your applet in both Firefox and IE6. However, I don't believe your site is set up >quite like mine, because it appears I can run your applet whether I have imported your X509 certificate or not. What I >did was:If that is true we are all dead :) No I think you just missed the cert in the IE databse. It doesn't have to be in the
    Applet database to function. Surprise!
    Check your IE/tools/internet options/content tab/certificates/trusted root certification authorities.
    I then opened the Java control panel and verified that the certificate isn't listed there, either. So unless the certificate >is being cached/read from some other location (which could be, this certificate stuff is largely black magic to me), >then your server isn't requiring client authentication, either accidentally or by design.No HyperView is a valid java2 Applet and actually writes to a file "hyperview.dat" though it is probably empty.
    If you click on a component in the view and then on the view and type "dumpgobs" it shoud write out some data about the current graphics objects so you can see it has complete read/write access..
    Further it opens up a complete NIO server ands starts listening for connections on a random port
    (Echoed in your java console) You can connect to it with telnet and watch impressive ping messages all day :)
    This all goes back to a few years BTW back before there was a plugin and there was only Netscape & IE.
    There are actually 2 certificate databases and what loads where depends on which type of cert you are using. Now self signed or not doesn't matter but what does matter is the type of certificate. IE: is it RSA/DSA/Sha1
    etc. The Netscape DB was a Berkley DB and MS used whatever they use. The Cert is a DSA/Sha1 cert
    which I like the best ATM as it (X fingers it stays so) always has worked.
    Sadly that tidbit doesn't help you either I am afraid.
    What I'm trying to do is require client authentication through Apache by including the following markup in a virtual >host definition:
    SSLCACertificateFile D:/Certificates/ca.crt
    SSLVerifyClient require
    SSLVerifyDepth 1You got me there I avoid markup at all costs and only code in C java and assembler :)
    Now unless I am wrong I think you are saying that you want the Applet to push the certificate to the server
    automatically and I don't think this happens. Least I have never heard of this happening from an Applet automatically.
    On my client machine, I have a certificate which was generated using OpenSSL and the ca.crt file listed. Testing >shows that the server is requiring a certificate from the client, and the web browser is always providing it.
    The problem is that when the browser fires up the Java plugin to run an applet, there is not sufficient communication >between the browser and the plugin so that the plugin can obtain the certificate from the browser and provide it to >the server.
    So the server refuses to send the applet bytecode to the JVM, and we're stuck.In terms of implementation ease I think you may have the cart before the horse because I think it would be far easier to run an Applet in the first place to do the authentication, and then send, for example, a jar file to bootstrap and run
    (or some classes) in the event the connection is valid. Then again one never knows it all and there may be some classes which enables the plugin as you wish. I have never heard of this being done with the plugin the way you suggest.
    I am thinking maybe there is another method of doing this I do not know.
    Did you try pushing the cert via JavaScript/LIveConnect?? That way it could run before the Applet and do the authentication.
    Maybe someone else has other ideas; did you try the security forum??
    Sorry but I am afraid that is not much help.
    I did snarf this tidbit which may have some relevance
    The current fix for this bug in Mantis and 1.4.1_02 is using JSSE API, Here are the step:
    In Java control panel, Advanced tab -> Java Runtime Parameters, specify:
    -Djavax.net.ssl.keyStore=<name and path to client keystore file>
    -Djavax.net.ssl.keyStorePassword=<password to access this client keystore file>
    If it is a PKCS12 format keystore, specify:
    -Djavax.net.ssl.keyStoreType=PKCS12
    In our future JRE release 1.5, we will create our own client authentication keystore file for JPI and use that for client authentication, for detail info, please see RFE 4797512.
    Dennis
    Posted Date : 2005-07-28 19:55:50.0Good Luck!
    Sincerely:
    (T)
    Edited by: tswain on 23-Jul-2008 10:07 AM

  • ___How to access database behind firewall with JDBC___

    How to access a database behind a firewall? I have an applet that runs from a server behind that firewall. I can make applet-servlet-database calls, but I cannot make applet-database calls. Therefore, I must go through servlets.
    This causes a problem as the ResultSet object is not serializable. I have found two solutions using a search.
    1) Store info into a Vector and transmit the vector. This option will take up a huge amount of time with large ResultSets.
    2) Used sun's CachedRowSet which is serializable. I read the liscence under the CashedRowSet, and it does not allow use for "productive and commercial" use.
    Does anyone have any other suggestions I am missing?

    I'm pretty sure there are other implementations of CachedResultSet out there that don't have the licensing restrictions on them, so maybe you could hunt down one of those.
    As far as storing it in a Collection of some kind, I've never found a huge performance problem in doing so. When iterating through the ResultSet anyway, the additional cost of placing data in a different structure is minimal, even on larger results.

  • Problems While Createing Lite Database for Palm

    Hello Everybody
    I want to use OracleLite to develop a Palm application using Satellite Forms EE.
    When i am going to create new Oracle Lite Database in the Oracle8 Navigator at that time in the New Oracle Lite Database Properties dialog box it can not display the Consolidator Support check box.
    Documentation says Consolidator Support check box must be true for creating a new database for Palm platform.
    How can i get this check box?
    Is this CheckBox is necessary for creating a Datapase for Palm Platform?
    Documentation also says after creating the New database The database contains the
    Consolidator folder, which includes the folders: Client, Publication, and Sequence.
    but i can not get the Consolidator folder after creating new database,hence i can not get Client,Publication and Sequence folder.
    I have installed OraceleLite on WindowsNT Server.
    I have intalled iConnect Consolidator Server, Client and Admin on WindowsNT.
    I am using Orace8 server
    can anybody provides me any suggesions rather soluation?
    Please help me.
    Thainks
    Priyesh
    null

    baftos wrote:
    Maybe I should question the need to access a local database on the client PC.
    But anyway, the normal way to obtain security clearance is to use a signed applet.
    Another possibility is to grant the applet all permissions by modifying the security policy file of each client to grant your applet 'all permissions'. Note that in this case you must have access to each and every client PC or ask them to do so before running the applet.Database access at client's machine is ridiculous. I doubt this is what OP wants.
    @OP: request you to post the original security issue and the environment details.
    Thanks,
    Mrityunjoy

Maybe you are looking for