tomcat-users mailing list archives

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

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

>-----Original Message-----
>From: Marot Laurent []
>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
>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
>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  :-)
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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:
For additional commands, e-mail:

View raw message