As Yoav says, it works, and is very easy to use once you have it configured.

But note that lots of people seem to have trouble getting the config right.
I was one of those.  You have to persevere a bit.  The problem I had was
that there are lots of pages on lots of websites that describe how to do it,
and each page explains one of a number of different approaches (there is
more than one way to do it, besides the one you linked to, but don't worry
about that for now - the approach on that page is fine).  Stick carefully to
the set of instructions in your link, and it should work.

> -----Original Message-----
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday 13 October 2004 15:26
> To: Tomcat Users List
> Subject: RE: Connection Pooling using JNDI DataSource
> 
> 
> 
> 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:[EMAIL PROTECTED]
> >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-datasour
> ce-example
> s-
> >howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurat
> ions (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: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to