Check the configuration:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
5.5 has a different set up than 5.0 .
You also need a resource link. See: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/globalresources.html at the bottom of the page.
It has also be noted on the list that the odbc drivers are not suited for production. But this will not cause your problem.
Doug
----- Original Message ----- From: "Chirag" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, January 27, 2005 1:15 AM
Subject: Chirag: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Software jakarta-tomcat-5.5.2 JDK 1.5 MS Access 2000
Requirements Connection Pooling in Tomcat
Problem
I inserted a resource Tag in server.xml file
<Resource name="aaa" type="javax.sql.DataSource"/> <ResourceParams name="aaa"> <parameter> <name>maxWait</name> <value>5000</value> </parameter> <parameter> <name>maxActive</name> <value>4</value> </parameter> <parameter> <name>password</name> <value>password</value> </parameter> <parameter> <name>url</name> <value>jdbc:odbc:aaa</value> </parameter> <parameter> <name>driverClassName</name> <value>sun.jdbc.odbc.JdbcOdbcDriver</value> </parameter> <parameter> <name>maxIdle</name> <value>2</value> </parameter> <parameter> <name>username</name> <value>username</value> </parameter> </ResourceParams>
I also inserted the following line in web.xml.
<resource-ref> <res-ref-name>aaa</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
After that I tried to access the java.sql.Connection Object by the following code in JSP
javax.naming.Context initContext = new javax.naming.InitialContext();javax.naming.Context envContext = (javax.naming.Context)initContext.lookup("java:/comp/env");javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup("aaa");java.sql.Connection conn = ds.getConnection();System.out.println(conn);conn.close();
The following Exception occured
HTTP Status 00 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.B2bSite.test_jsp._jspService(org.apache.jsp.B2bSite.test_jsp:105) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) temp.loginServlet.doFilter(loginServlet.java:34) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) org.apache.jsp.B2bSite.test_jsp._jspService(org.apache.jsp.B2bSite.test_jsp:88) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) temp.loginServlet.doFilter(loginServlet.java:34) note The full stack trace of the root cause is available
in the Apache Tomcat/5.5.2 ogs. -------------------------------------------------------------------------------- Apache Tomcat/5.5.2
Thanks in advance
CSJakharia
Subscribe to bermudaEmail: [input] [input] Browse Archives at groups-beta.google.com
---------------------------------
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
