title: JDBC driver not found for PostgreSQL database while building with Maven
body: <p>I am following a course "Learning Path: Enterprise Web Programming with Java" by O'Reilly. I have re-written code for a simple webapp using PostgreSQL. I build it with Maven and run it on a Tomcat server. The database is up and filled. I receive the following error:</p>
  
  <blockquote>
    <p>javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for ${ourDS}"</p>
  </blockquote>
  
  <p>I have found that it is usually a result of no postgres dependency. I have also tried adding other dependencies like tomcat plugin, etc.
  I understand that I miss a small piece of dependency or some file somewhere, but I can not find out what is it.</p>
  
  <p>The main .jsp file has a following code:</p>
  
  <pre><code>&lt;%@ page errorPage = "error.jsp" %&gt;
  
  &lt;%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib uri = "http://java.sun.com/jsp/jstl/sql" prefix="sql" %&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;List of products in our database&lt;/title&gt;
      &lt;link rel = "stylesheet" href = "style.css" type = "text/css"&gt;&lt;/link&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;sql:setDataSource                    
            var = "ourDS"                                           
            driver = "org.postgresql.Driver"
            url = "jdbc:postgresql://localhost:5432/skistuff"
            user = "******" 
            password = "*******"
      /&gt;
  
      &lt;sql:query var = "productList" dataSource = "${ourDS}"&gt; 
          SELECT * FROM skisEtc ORDER BY id;
      &lt;/sql:query&gt;
     &lt;!-- Some kind of display --&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>In contrary to the lecturer, I use Maven instead of Ant, so I have to figure it out other way. From what was mentioned in the course, I prepared the following pom file:</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/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.training.skis&lt;/groupId&gt;
  &lt;artifactId&gt;skispagebasic&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;skispagebasic Maven Webapp&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;
  &lt;dependency&gt;
  &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet.jsp.jstl&lt;/groupId&gt;
      &lt;artifactId&gt;javax.servlet.jsp.jstl-api&lt;/artifactId&gt;
      &lt;version&gt;1.2.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
      &lt;artifactId&gt;jstl-impl&lt;/artifactId&gt;
      &lt;version&gt;1.2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
      &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
      &lt;version&gt;42.1.4.jre7&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;finalName&gt;skispagebasic&lt;/finalName&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>