title: Creating an application with Google Web Toolkit that interacts with MySQL
body: <p>I've created a web application in Java with Google Web Toolkit (GWT). On the client side, GWT generates an input box and (using the GWT search api) conducts a web search. I'd like to push some of the information from the web search into a MySQL database so that it can be analysed using a machine learning application (Weka). I've got an RPC running that interacts with server side code. In that server side code, I tried to establish a connection to the MySQL database. </p>
  
  <p>I'm currently running the project locally, so, as far as I can tell, google app engine is hosting it. This is supported by the fact that when I run the application I get the following message:</p>
  
  <pre><code>Initializing AppEngine server
  Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger  
  The server is running at http://localhost:8888/
  </code></pre>
  
  <p>However, although I'm able to use the search part of the application, it throws an exception when trying to connect with my MySql database. </p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.  
  Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission mysql.database.location resolve)  
  </code></pre>
  
  <p>I've tested the database connection from a regular (non-web based) Java program and there's no problem connecting to it from outside of the web application.  I believe that I'm getting this error because google app engine won't allow connections to outside databases. </p>
  
  <p>In short my questions are:<br>
  1. Although I'm using Google App Engine, is it possible to use a server side code to connect to MySQL? (I'm assuming no, but this would be ideal).<br>
  2. Is it possible to switch to another server (like Tomcat)? If so, can anyone point me to references about how to do this? I found an old stackoverflow question about how to use tomcat (http://stackoverflow.com/questions/2208181/gwt-app-deploying-on-tomcat-or-any-other-servlet-container) but it no longer directs to a place that has information about using other servers. </p>
  
  <p>Thanks for your help and please feel free to ask follow up questions if you'd like me to provide more info.</p>