Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AccessControl Exception (Access Denied)

 
Paul Houser
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to connect to a mySQL database in my Applet and I get this Exception on the line that connects to it:

java.sql.SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797)
at com.mysql.jdbc.Connection.<init>(Connection.java:562)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:361)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at unknown.DBConn.<init>(DBConn.java:25)
at unknown.Unknown.init(Unknown.java:22)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)

The applet is trying to connect to a database at localhost:3306, and the user I'm trying to connect with has all priveledges. The program seems to work when I run it as the local filesystem (through applet viewer), but it gives this exception when loading through an HTML file on my webserver (same machine).

Any help is appreciated.
[ August 17, 2004: Message edited by: Paul Houser ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,
Since you can connect to the database when you run the applet through the viewer, it sounds like an applet permission type problem. I'm going to move this to Applets where someone should be able to give you a more detailed answer.
 
Paul Houser
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! I wasn't sure when I posted where it should go.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul, you probabely have a better chance of getting a reply, if you change the title of the post to AccessControl Exception (Access Denied) in applet, or something similar.

Sonny
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic