Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-03-21T15:23:27Z by Forrest_Xia
SandeepSamdaria.
SandeepSamdaria.
1 Post
ACCEPTED ANSWER

Pinned topic JDBC Connection: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Drive

‏2011-01-08T00:27:44Z |
<% try
{String user="abcd";
String pwd="hello";
String url,driver;
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection con = DriverManager.getConnection("jdbc:db2:test",user,pwd);
// or should i use : Connection con = DriverManager.getConnection("jdbc:db2://localhost:50000/test",user,pwd);
String name,id,age,query;

query="SELECT * from user";
Statement st = con.createStatement();
st.executeQuery(query);
}

NOW i am getting this error.
Problem accessing /Testing/addDetail.jsp. Reason:

java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver

Caused by:
javax.servlet.ServletException: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at org.apache.jsp.addDetail_jsp._jspService(addDetail_jsp.java:87)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.lang.Class.forName(Class.java:136)
at org.apache.jsp.addDetail_jsp._jspService(addDetail_jsp.java:62)
... 22 more

Caused by:
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.lang.Class.forName(Class.java:136)
at org.apache.jsp.addDetail_jsp._jspService(addDetail_jsp.java:62)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

I am using RAD Standard Edition for WebSphere Software,DB2 express C edition and i am running the jsp on AJAX Test Server.
Updated on 2012-03-21T15:23:27Z at 2012-03-21T15:23:27Z by Forrest_Xia
  • db2chaplin
    db2chaplin
    1 Post
    ACCEPTED ANSWER

    Re: JDBC Connection: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Drive

    ‏2011-01-20T08:44:03Z  in response to SandeepSamdaria.
    what is ur db2 version ?
  • V_Singh
    V_Singh
    1 Post
    ACCEPTED ANSWER

    Re: JDBC Connection: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Drive

    ‏2012-03-13T04:02:35Z  in response to SandeepSamdaria.
    Use the following statement:

    Connection con = DriverManager.getConnection("jdbc:db2://localhost:50000/test",user,pwd);
    • SystemAdmin
      SystemAdmin
      2233 Posts
      ACCEPTED ANSWER

      Re: JDBC Connection: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Drive

      ‏2012-03-21T11:54:20Z  in response to V_Singh
      db2 version is 9 ibm rad 8 websphere 8 and getting same error pls help me
      • Forrest_Xia
        Forrest_Xia
        82 Posts
        ACCEPTED ANSWER

        Re: JDBC Connection: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Drive

        ‏2012-03-21T15:23:27Z  in response to SystemAdmin
        Please post to WAS forum for a timely response, this forum is for WAS Community Edition and Geronimo.