title: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot load JDBC driver class 'org.hsql.jdbcDriver'
body: <p>I am not to sure why I am unable to connect to my database. I am using JNDI, and maven to help handle the dependencies. In my context.xml in my server folder in eclipse looks like:</p>
  
  <pre><code>Could not get JDBC Connection; nested exception is java.sql.SQLException:  
  Cannot load JDBC driver class 'org.hsql.jdbcDriver'
  </code></pre>
  
  <p>context.xml</p>
  
  <pre><code>&lt;Context&gt;
  
      &lt;!-- Default set of monitored resources. If one of these changes, the --&gt;
      &lt;!-- web application will be reloaded. --&gt;
      &lt;WatchedResource&gt;WEB-INF/web.xml&lt;/WatchedResource&gt;
      &lt;WatchedResource&gt;${catalina.base}/conf/web.xml&lt;/WatchedResource&gt;
  
      &lt;Resource name="jdbc/Spring_Tutorial" auth="Container"
          type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
          username="root" driverClassName="org.hsql.jdbcDriver"
          url="jdbc:mysql://localhost:3306/Spring_Tutorial" /&gt;
  
      &lt;!-- Uncomment this to disable session persistence across Tomcat restarts --&gt;
      &lt;!-- &lt;Manager pathname="" /&gt; --&gt;
  
      &lt;!-- Uncomment this to enable Comet connection tacking (provides events 
          on session expiration as well as webapp lifecycle) --&gt;
      &lt;!-- &lt;Valve className="org.apache.catalina.valves.CometConnectionManagerValve" 
          /&gt; --&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>this class handles the error if it is unable to connect:</p>
  
  <pre><code>@ControllerAdvice
  public class DatabaseErrorHandler {
  
      @ExceptionHandler(DataAccessException.class)
      public String handleDatabaseException(DataAccessException ex) {
  
          System.out.println("Error connecting to Database: "+ex);
  
          return "error";
      }
  
  }
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.spring.practice&lt;/groupId&gt;
    &lt;artifactId&gt;offers&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.35&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;version&gt;1.1.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate&lt;/artifactId&gt;
          &lt;version&gt;3.5.4-Final&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;5.1.3.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
          &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;hsqldb&lt;/groupId&gt;
          &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
          &lt;version&gt;1.8.0.10&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;description&gt;Database&lt;/description&gt;
    &lt;resource-ref&gt;
      &lt;description&gt;DB Connection&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/Spring_Tutorial&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;
  </code></pre>
  
  <p>I added the hsqldb jar file but I really did not think I needed it</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;hsqldb&lt;/groupId&gt;
          &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
          &lt;version&gt;1.8.0.10&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>From my understand I just need the mysql-connector-java dependency </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;5.1.35&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>My database's name is Spring_Tutorial and I am using mySQL Workbench.</p>
  
  <p>Am I blindly missing something here?</p>