tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikolaj Rydzewski <m...@ceti.pl>
Subject Re: Trouble with context and JNDI resource
Date Tue, 03 Nov 2009 14:10:49 GMT
Mike Baranski wrote:
> 		<Resource name="proteus" auth="Container"
> type="org.apache.commons.dbcp.BasicDataSource"
>   
Why not to use jdbc/proteus? Just to follow convention. I'd also rather 
use javax.sql.DataSource as type attribute.
> 		<resource-env-ref-name>
> 			proteus
> 		</resource-env-ref-name>
>   
The same, use jdbc/proteus.
> I have this code:
>
> l.debug("Created the status xmlrpc class");
> Context initCtx = new InitialContext();
> Context envCtx = (Context) initCtx.lookup("");
> this.setDataSource((BasicDataSource) envCtx.lookup("proteus"));
>   
What about following:

new InitialContext().lookup("java:comp/env/jdbc/proteus");


-- 
Mikolaj Rydzewski <miki@ceti.pl>


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


Mime
View raw message