title: JDBC driver loading issue in JDBC connection pooling
body: <p>I have setup the JDBC connection pooling and its showing the following error when I execute a sample JSP page trying to use a connection.</p>
  
  <pre><code>Error occurred org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load 
      JDBC driver class 'com.sybase.jdbc3.jdbc.SybDriver' 
  </code></pre>
  
  <p>I have placed the <code>jconn2.jar</code> both in <code>common/lib</code> and <code>web-inf/lib</code> as well.
  How do I rectify the error?</p>
  
  <pre><code>    The context.xml
  
  &lt;Context&gt;
          &lt;Resource name="jdbc/mysybase" auth="Container"
                    type="javax.sql.DataSource" driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
                    url="jdbc:sybase:Tds:H2S33.studtrack.com:2025/student"
                    username="scott" password="tiger" maxActive="20" maxIdle="10"
                    maxWait="-1"/&gt;
      &lt;/Context&gt;
  
  
      In The web.xml file
      &lt;resource-ref&gt;
       &lt;description&gt;Sybase Datasource example&lt;/description&gt;
       &lt;res-ref-name&gt;jdbc/mysybase&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;
  
  
      And the jsp page
  
      &lt;%@page import="java.sql.*"%&gt;
      &lt;%@page import="javax.naming.Context"%&gt;
      &lt;%@page import="javax.naming.InitialContext"%&gt;
      &lt;%@page import="java.sql.Connection"%&gt;
      &lt;%@page import="java.sql.SQLException"%&gt;
      &lt;%@page import="java.sql.ResultSet"%&gt;
      &lt;%@page import="javax.sql.DataSource"%&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;title&gt;Obtaining a Connection&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;%
          Connection conn = null;
          ResultSet result = null;
          Statement stmt = null;
           try {
             Context initContext = new InitialContext();
          Context envContext  = (Context)initContext.lookup("java:/comp/env");
             DataSource ds = (DataSource)envContext.lookup("jdbc/mysybase");
             conn = ds.getConnection();
          if (conn != null) 
          {
              String message = "Got Connection " + conn.toString() + ", ";
              out.write(message);
          }
          else
          {
              out.write("hello no conn obtained");
  
          }
  
              stmt = conn.createStatement();
              result = stmt.executeQuery("SELECT * FROM Student");
          while(result.next())
          {
              out.write(result.getString("name"));
          }
  
           }
           catch (SQLException e) {
               out.write("Error occurred " + e);
            }
  
      %&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;`
  </code></pre>