I am using the host that served my applet.  I also already tried both, putting 
in "localhost", as well as, putting the IP address in the code.  Neither 
worked.  I still get the same error message with one small difference.  When I 
used the IP address, I received this error:

SQLException: Unable to connect to any hosts due to exception: 
java.security.AccessControlException: access denied (java.net.SocketPermission 
155.47.139.247:3306 connect,resolve)
SQLState: 08S01
VendorError: 0

When I used "localhost" I received this error:

SQLException: Unable to connect to any hosts due to exception: 
java.security.AccessControlException: access denied (java.net.SocketPermission 
127.0.0.1:3306 connect,resolve)
SQLState: 08S01
VendorError: 0

                           Nathan E. Pierce



Quoting Sergei Skarupo <[EMAIL PROTECTED]>:

> Generally applets are anly allowed to access the host that served them. 
> 
> Try to use the host name (localhost or whetever your machine is called)
> rather than the IP address, or conversely, give the IP address rather than
> "localhost" to the browser. 
> 
> I don't know whether applets are restiricted to the same port or not. If they
> are, you're out of luck. You can ask for permissions on the client machine,
> but that's really not worth the trouble. In any case, a better solution would
> be to let the web server access the database.
> 
> 
> 
> 
> -----Original Message-----
> From: Nathan Pierce [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 04, 2004 5:57 PM
> To: [EMAIL PROTECTED]
> Subject: SQLException: Unable to connect to any hosts due to exception:
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 127.0.0.1:3306 connect,resolve)
> 
> 
> I am trying to connect to a database which is being served off of my machine
> 
> (same one I am using to connect to it).  It works fine when I do- 
> System.out.println(rs.getString("D.Name") );- and it prints it out in an 
> application.  But when I try to output it in an applet, it gives me this
> error:
> 
> SQLException: Unable to connect to any hosts due to exception:         
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 
> 127.0.0.1:3306 connect,resolve)
> SQLState: 08S01
> VendorError: 0
> 
> Does anyone know what this means, or how to fix this?
> 
>        Thanks in advance, 
>                     Nathan E. Pierce
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to