aspose file tools*
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
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