tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Donahue - RDSA IT <LeoDona...@mail.maricopa.gov>
Subject RE: <resource-ref> in web.xml
Date Thu, 18 Apr 2013 02:52:12 GMT
________________________________________
From: Jakub 1983 [jjakub83@gmail.com]
Subject: <resource-ref> in web.xml

when I define database conn in context.xml, resource-ref is not needed at
all, so what is it actually for ?

**************************************************************
You need something to lookup from your Java src file:

Context ctx = new InitialContext();
ds = (DataSource) ctx.lookup("java:comp/env/jdbc/whatever_you_called_this_in_resource-ref");
(res-ref-name that is)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message