title: AccessControlException while connecting MySQL using JDBC in GWT hosted mode
body: <p>I want to connect to a mysql database at localhost:3306 using jdbc in a GWT servlet, but when I try connecting I get this error:</p>
  
  <pre><code>java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
  ...
  </code></pre>
  
  <p>I know that I need to apply a security policy for tomcat to solve this problem, something like this:</p>
  
  <pre><code>grant codeBase "file:${catalina.home}/webapps/-" {
      permission java.net.SocketPermission "192.168.12.81:3306", "connect";
  };
  </code></pre>
  
  <p>But I don't know where should I apply this change? Please provide a solution for both hosted &amp; web mode.</p>