Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7442481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:10:51+00:00 2026-05-29T11:10:51+00:00

I have setup the JDBC connection pooling and its showing the following error when

  • 0

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.

Error occurred org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load 
    JDBC driver class 'com.sybase.jdbc3.jdbc.SybDriver' 

I have placed the jconn2.jar both in common/lib and web-inf/lib as well.
How do I rectify the error?

    The context.xml

<Context>
        <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"/>
    </Context>


    In The web.xml file
    <resource-ref>
     <description>Sybase Datasource example</description>
     <res-ref-name>jdbc/mysybase</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
    </resource-ref>


    And the jsp page

    <%@page import="java.sql.*"%>
    <%@page import="javax.naming.Context"%>
    <%@page import="javax.naming.InitialContext"%>
    <%@page import="java.sql.Connection"%>
    <%@page import="java.sql.SQLException"%>
    <%@page import="java.sql.ResultSet"%>
    <%@page import="javax.sql.DataSource"%>
    <html>
    <head>
    <title>Obtaining a Connection</title>
    </head>
    <body>

    <%
        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);
          }

    %>

    </body>
    </html>`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:10:52+00:00Added an answer on May 29, 2026 at 11:10 am

    Sybase JDBC driver has different package naming in different versions. You are trying to load newer version com.sybase.jdbc3.jdbc.SybDriver, while your jar most likely contains older com.sybase.jdbc2.jdbc.SybDriver.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up jdbc connection pooling in a java-ee environment by doing the
I have a strange problem with jdbc connection to an oracle database server. We've
I've been trying to obtain the Driver class for JDBC connection to MySQL. The
I am trying to set up connection pooling to mysql databe with tomcat. My
I have a tomcat instance setup but the database connection I have configured in
I am using Oracle 9 JDBC Thin Driver - the connection string I have
I am getting this error. I have my hibernate connections and MVC all setup
On a glassfish server I have a JDBC Connection pool set up for my
How can I setup connection pooling in Spring MVC? I am working on an
I have setup web dav on windows server 2008. It seems to work fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.