Re: jdbc connect problems

From: Vince (vgodefroy_at_yahoo.fr)
Date: 10/18/03

  • Next message: martin Mangaard: "odbc and CE ( I need to know how i setup an odbc driver on win CE and were i can find it)"
    Date: Sat, 18 Oct 2003 21:37:23 +0200
    
    

    Ike wrote:
    > I have an applet which connects to a MySQL database with the GNU JDBC
    > driver. When I run the applet in appletViewer on my local machine, it
    > connects to the remote server just fine.
    >
    > However, when I put the applet up on the remote server, and invoke it
    > through the browser, signing in with the same parameters as before for
    > server/user/password, etc., I get:
    >
    > "Database access failed java.sql.SQLException: Unable to connect to any
    > hosts due to exception: java.security.AccessControlException: access denied
    > (java.util.PropertyPermission file.encoding read)"
    >
    > The Applet is digitally signed. The driver jar as well as the application
    > jar are both in htttp://mydomain.com/WEB-INF/lib (this is on Tomcat)
    >
    > Anyone have any clue why I can connect when I run it in appletViewer in my
    > local machine, but not from within the browser from the server itself?
    > Thanks, Ike
    >
    >

    applets are designed with maximum security restrictions. i.e. no access
    to file system nor connection of any kind. But there is possibility to
    write a policy file to grant access to an applet to do such things.

    i've had this problem whith an applet which needed to connect via RMI
    and solved it in this way.


  • Next message: martin Mangaard: "odbc and CE ( I need to know how i setup an odbc driver on win CE and were i can find it)"

    Relevant Pages

    • AccessControlException when running with applet
      ... as a panel and several other classes. ... the Panel, instead of the driver. ... When I run the Applet, ... public class AppletPotter extends JApplet ...
      (comp.lang.java.programmer)
    • Re: getting started with databases
      ... > I need to write a simple applet that will use a simple database (actually, ... > have to load some driver. ... > 1) What is the name of the driver for mdb files? ...
      (comp.lang.java.help)
    • Help with Swing Applet
      ... I uploaded my applet(class file and DB driver and html). ... My applet is suppose to query DB and then according to the result to draw ... I have error msg: ... My db and web server are in the same machine. ...
      (comp.lang.java.gui)
    • Help with Java Swing Applet!
      ... I uploaded my applet(class file and DB driver and html). ... My applet is suppose to query DB and then according to the result to draw ... I have error msg: ... My db and web server are in the same machine. ...
      (comp.lang.java.programmer)
    • Re: Moving Java Applet from Sun Environment to Windows..
      ... nothing about Java, other then hearing it's not platform dependent, I ... If the Applet uses JDBC directly to access the database, ... If the driver is written in Java, ... If it is a native driver, ...
      (comp.lang.java.programmer)