title: java.sql.SQLException: No suitable driver found for localhost test
body: <p>When trying to connect to mysql I always get this error: </p>
  
  <blockquote>
    <p>java.sql.SQLException: No suitable driver found for localhost test</p>
  </blockquote>
  
  <p>I already included the <code>mysql-connector.jar</code> in the <code>/WEB-INF/lib</code> in my app. What else do I need to configure to make it work? Do I need to add something in <code>web.xml</code>? I'm not using the appengine.</p>
  
  <p>Here is my code in the server:</p>
  
  <pre><code>package com.mysql.server;
  
  import java.sql.Connection; 
  import java.sql.DriverManager;
  
  import com.google.gwt.user.server.rpc.RemoteServiceServlet;
  import com.mysql.client.ConnDb;
  
  public class ConnDbImpl extends RemoteServiceServlet implements ConnDb {
     public Connection con;
     @Override
      public String tryConn() {
       try{
         String host = "localhost";
         String db = "test";
         String driver = "com.mysql.jdbc.Driver";
         String user = "root";
         String pass = "pwd";
  
         Class.forName(driver).newInstance();
         con = DriverManager.getConnection(host+db, user, pass);
         return "Connected to Database";
       } catch(Exception ex) {
           return ex.toString();
       }    
     } 
  }
  </code></pre>