tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Baranski" <list-subscripti...@secmgmt.com>
Subject RE: Trouble with context and JNDI resource
Date Tue, 03 Nov 2009 14:30:01 GMT
That worked, thanks.

>-----Original Message-----
>From: Mikolaj Rydzewski [mailto:miki@ceti.pl]
>Sent: Tuesday, November 03, 2009 9:11 AM
>To: Tomcat Users List
>Subject: Re: Trouble with context and JNDI resource
>
>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


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


Mime
View raw message