Sean Breslin wrote:
> I tried changing it to an applet, embedding it
> into an html page, and uploading that to my
> webspace at the same domain that I set the
> database up on, and I get a similar looking, but
> longer error.
>
> My connection string:
> "jdbc:mysql://localhost:3306/dbname?user=user&
> password=pass"
>
> The port being 3306 is an assumption. I don't
> actually know how to find out what port the DB is
> listening on, but in most tutorials I find 3306
> seems to be a standard.
>
> Here's the error I get now:
>
> Communications link failure due to underlying
> exception:
>
> ** BEGIN NESTED EXCEPTION **
>
> java.net.SocketException
> MESSAGE: java.security.AccessControlException:
> access denied (java.net.SocketPermission
> 127.0.0.1:3306 connect,resolve)
That's because for security reasons, applets (unless digitally signed) only allow connections to be made back to the exact same host (including exact IP address) that the applet was downloaded from.
You're in for a world of similar issues if you're going to be trying to deploy applets that need to talk over the network on any protocol other than HTTP.
Maybe if you posted what you're trying to accomplish, we could give you some ideas on how to make it work?
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html