title: The infamous java.sql.SQLException: No suitable driver found
body: <p>I'm trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).</p>
  
  <p>The app itself talks to Postgres just fine, so I know that the database is up, user can access it, all that good stuff. What I'm trying to do is a database query in a JSP that I've added. I've used the config example in the <a href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html" rel="noreferrer"> Tomcat datasource example</a> pretty much out of the box. The requisite taglibs are in the right place -- no errors occur if I just have the taglib refs, so it's finding those JARs. The postgres jdbc driver, postgresql-8.4.701.jdbc3.jar is in $CATALINA_HOME/common/lib.</p>
  
  <p>Here's the top of the JSP:</p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  
  &lt;sql:query var="rs" dataSource="jdbc/mmas"&gt;
    select current_validstart as ValidTime from runoff_forecast_valid_time
  &lt;/sql:query&gt;
  </code></pre>
  
  <p>The relevant section from $CATALINA_HOME/conf/server.xml, inside the <code>&lt;Host&gt;</code> which is in turn within <code>&lt;Engine&gt;</code>:</p>
  
  <pre><code>&lt;Context path="/gs2" allowLinking="true"&gt;
    &lt;Resource name="jdbc/mmas" type="javax.sql.Datasource"
        auth="Container" driverClassName="org.postgresql.Driver"
        maxActive="100" maxIdle="30" maxWait="10000"
        username="mmas" password="very_secure_yess_precious!"
        url="jdbc:postgresql//localhost:5432/mmas" /&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>These lines are the last in the  tag in webapps/gs2/WEB-INF/web.xml:</p>
  
  <pre><code>&lt;resource-ref&gt;
    &lt;description&gt;
       The database resource for the MMAS PostGIS database
    &lt;/description&gt;
    &lt;res-ref-name&gt;
       jdbc/mmas
    &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>Finally, the exception:</p>
  
  <pre><code>   exception
      org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
      [...wads of ensuing goo elided]
  </code></pre>