I am trying to connect to MySql database but I got below exception:
java.sql.SQLException: Unable to connect to any hosts due to
exception: java.security.AccessControlException: access denied
(java.net.SocketPermission localhost resolve)
and this is a piec of my code:
Class.forName("org.gjt.mm.mysql.Driver");
con = DriverManager.getConnection
("jdbc:mysql://localhost:3306/db","test","102030" );
I have tested this code in my station and it is Ok, I got this
exception when I tried to host it in a valid IP address.
I apprecite your comments.