tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Connection Pooling using JNDI DataSource
Date Wed, 13 Oct 2004 14:25:44 GMT

Hi,
Yeah, it works.  Note that your choice of words is a bit misleading: you
don't configure anything in web.xml, you only declare a resource
reference there.  The declaration and configuration of the resource
itself is all in server.xml.

Yoav Shapira http://www.yoavshapira.com
 

>-----Original Message-----
>From: Marot Laurent [mailto:Laurent.Marot@alliacom.com]
>Sent: Wednesday, October 13, 2004 10:33 AM
>To: Tomcat Users List
>Subject: Connection Pooling using JNDI DataSource
>
>Hi all,
>
>Could you please confirm me that when using JNDI DataSource described
there
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-example
s-
>howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations (just
>defining the Datasource in your server.xml file and configuring the
>resource in web.xml) and adding the code below in every page (or better
in
>a bean) i would get all the DBCP functionalities.
>
>So for instance, each time i'll made a getConnection i will use a
>connection from the pool and not creating one.
>
>
>Context initContext = new InitialContext();
>Context envContext  = (Context)initContext.lookup("java:/comp/env");
>DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>Connection conn = ds.getConnection();
>
>seems to be too simple to work this way, isn't it  :-)
>
>
>Thanks
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


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


Mime
View raw message