在linux下,开发一个web应用,期间调用数据库时总是不成功,如果单独写一个类,并编译执行访问数据库,正常,但是用web应用来调这个类连接数据库,就会出现错误:com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:   ** BEGIN NESTED EXCEPTION **   java.security.AccessControlException   MESSAGE: access denied (java.net.SocketPermission localhost resolve)   STA CKTRACE:   java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve) CKTRACE:   java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)