This discussion is archived
2 Replies Latest reply: Feb 23, 2012 1:32 AM by EJP RSS

Tomcat connection pool is just impossible, Oracle XE

913454 Newbie
Currently Being Moderated
Hi All,

I am using (trying to) Tomcat 6, Eclipse 3.5 and Oracle XE 11.2.

I am not using Struts or Spring, but want to use Tomcat's connection pooling (as I am new to all this, correct me if I am wrong).

This is my JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<sql:query var="rs" dataSource="jdbc/mydb"> select table_name from user_tables </sql:query>

<html>
  <head>    <title>DB Test</title>  </head>
<body>
<h2>Results</h2>
<table>  
<c:forEach var="row" items="${rs.rows}">
  <tr>     <td>${row.table_name}</td>  </tr>
</c:forEach>
</table>
</body>
</html>
The file <tomcat home>/conf/context.xml has
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
        <Resource name="jdbc/mydb" 
              auth="Container"
              type="javax.sql.DataSource" 
              driverClassName="oracle.jdbc.OracleDriver"
              url="jdbc:oracle:thin:@127.0.0.1:1521:XE"
              username="rax" 
              password="rax" 
              maxActive="10" 
              maxIdle="1"
              maxWait="-1"/>
</Context>
web.xml of my application has
<resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/mydb</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>
And I am getting error
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
What all places I need to put configurations to get this thing working?
I am totally confused.

Thanks in advance.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points