This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Re Connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Re Connection pooling" Watch "Re Connection pooling" New topic
Author

Re Connection pooling

kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197


I know conn.close() returns the Connection to the pool, but does ds.getConnection() get a new Connection or simply get one from the pool. If so, at what point is a new Connection made?


Who dares, wins! (SAS motto)
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
The pool decides whether to reuse an existing connection or create a new one. It does so based on the way the pooling code was written, and the way you configure it.
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Thanks stu..

the code above doesn't seem to be working for me though!



initCtx cannot be resolved

I'm using the code below in Tomcat 5.5






I tried placing <Context> in /META-INF/context.xml, then i tried placing it CATALINA_HOME/conf/server.xml and niether is working??

My web.xml has this (I'm using Servlet 2.4/ J2SE 1.5)



[ June 09, 2006: Message edited by: kwame Iwegbue ]

[ June 09, 2006: Message edited by: kwame Iwegbue ]
[ June 09, 2006: Message edited by: kwame Iwegbue ]
Martin Simons
Ranch Hand

Joined: Mar 02, 2006
Posts: 196
Should not your resource ref be jdbc/EmployeeDB and not jdbc/DB ?
 
wood burning stoves
 
subject: Re Connection pooling
 
Similar Threads
Closing The connection (Database)
whether connection pool will available at the time of starting the server
Difference between DataSource and ConnectionPoolDataSource
JDBC connection pool
database connection in init() of servlet