tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marot Laurent" <>
Subject Connection Pooling using JNDI DataSource
Date Wed, 13 Oct 2004 14:32:41 GMT
Hi all,

Could you please confirm me that when using JNDI DataSource described there
(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  :-)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message