title: java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'
body: <p>I've been trying to configure Tomcat to access MySQL database in IntelliJ but without much success. </p>
  
  <p>I have placed mysql-connector-java-5.1.20. jar into Tomcat8.5/lib/</p>
  
  <p>This is my context.xml file that is placed in WEB-INF/lib/ 
      </p>
  
  <pre><code>&lt;Context&gt;
     &lt;WatchedResources&gt;WEB-INF/web.xml&lt;/WatchedResources&gt;
  
     &lt;Resourse name="jdbc/web_student_tracker"
        auth="Container" type="javax.sql.DataSource"
        maxActive="20" maxIdle="5" maxWait="10000"
        username="webstudent" password="webstudent"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/web_student_tracker"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Web.xml file is place in WEB-INF/ </p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
       http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
       version="3.1"&gt;
  
    &lt;resource-ref&gt;
      &lt;description&gt;MySQL Data Source Example&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/web_student_tracker&lt;/res-ref-name&gt;
      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
    &lt;/resource-ref&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>This is what my servlet looks like </p>
  
  <pre><code> @WebServlet(name = "TestServlet", urlPatterns = {"/testServlet","/a"})
   public class TestServlet extends HttpServlet {
  
   //define datasource/connection pool for resource injection
   @Resource(name="jdbc/web_student_tracker")
   private DataSource dataSource;
  
   protected void doPost(HttpServletRequest request, HttpServletResponse 
    response) throws ServletException, IOException {
  
   }
  
    protected void doGet(HttpServletRequest request, HttpServletResponse 
    response) throws ServletException, IOException {
      //set the printwriter
      PrintWriter out = response.getWriter();
      response.setContentType("text/plain");
  
      //get a connection to the database
      Connection myConn =null;
      Statement myStmt = null;
      ResultSet myRs = null;
  
      try {
          // create a sql statements
          myConn = dataSource.getConnection(); // fails here
  
          // execute sql query
          String sql = "select * from student";
  
          myStmt = myConn.createStatement();
  
          //process the result set
          myRs = myStmt.executeQuery(sql);
  
          while(myRs.next())  {
              String email = myRs.getString("email");
              out.println(email);
          }
      }
      catch ( Exception exc)  {
          exc.printStackTrace();
      }
    }
   }
  </code></pre>
  
  <p>When I try to get a connection from a datasource, I get the following exception:</p>
  
  <pre><code>java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 
  'null'
  ...
  Caused by: java.sql.SQLException: No suitable driver
  at java.sql.DriverManager.getDriver(DriverManager.java:315)
  ...
  </code></pre>
  
  <p>What am I doing wrong or missing ?
  Thank you for your time and help!</p>