Not a problem.

 <Resource> config located in:  .../webapps/chngctrl/META-INF/context.xml -
<Context>
<Resource name="jdbc/myoracle" 
auth="Container" 
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
 maxActive="125" 
 maxIdle="15" 
 maxWait="70000"
 removeAbandoned="true"
 removeAbandonedTimeout="300"
 logAbandoned="true"
username="username" 
password="userpass" 
url="jdbc:oracle:thin:@servername:1526:SID"
minEvictableIdleTimeMillis="5000"
timeBetweenEvictionRunsMillis = "10000"
testWhileIdle="true" />
</Context>
-----------------------
In web.xml, located in.../webapps/chngctrl/WEB-INF/web.xml 
(for what it's worth, and I think it's immaterial, this at the top-)

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
   version="2.5"> 

<resource-ref>
    <description>Change Ctrl App</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-ref-type>javax.sql.DataSource</res-ref-type>
    <res-auth>Container</res-auth>
  </resource-ref>


JSP located in ../webapps/chngctrl/change_ctrl_reporting.jsp  calling another 
JSP with these contents:

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");

// Look up our data source
DataSource ds = (DataSource) envCtx.lookup("jdbc/myoracle");

// Allocate and use a connection from the pool
Connection connection = ds.getConnection();

All this has worked fine in 4.1.31 -- the two different versions of TC 6 (.0.18 
and 0.24) I've not had any luck with it.

I can pass the parameters through just fine and pull back the data, not with a 
NamingContext.


-----Original Message-----
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Thursday, March 18, 2010 11:41 AM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

> From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
> Subject: RE: DB connection error -Tomcat 6 config
> 
> Yes, and it's essentially the same. And I seem to have gotten this no 
> matter the version I've tried out (6.018, 6.0.24, etc.)

If you don't mind, please repost your <Resource> configuration, remind us where 
it's located, and show us the code in your chngctrl JSP that gets the DB 
connection.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to