Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling

 
Josh_Batchelor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a Connection Pool that I instantiate with <jsp:useBean id="email" scope="application" class="connectionpool.ConnectionPool" />. My question is how would I use this from another servlet?
[ Edited by Dave to fix the < ]
[This message has been edited by David O'Meara (edited December 17, 2001).]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Josh_Batchelor",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
Thanks.
Dave
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone please correct me if I'm wrong, but isn't connection pooling managed not by the programmer but by the container?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the container/server. I know websphere already has a connection pool manager. But say you are using Tomcat, then you have to code and manage your own connection pooling.
------------------
Bosun
SCJP for the Java� 2 Platform
 
C Balajee
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bosun,
I also aggree that closing the conection will in turn close the statement and the resultset.
By "closing" you must mean that that the particular statement/resultset is not available for further use..
My query is what will happen if a reference to the closed resultset still exists in the memory..??
Will the connection pool manager of WebSphere release the connection for further use??
regards
C Balajee
 
C Balajee
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry Guys,
I posted the wrong reply in the wrong thread...
regards
C Balajee
 
C Balajee
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my correct post..
You can try the following code in other JSP's or servlets..
session.getAttribute("email");
this will return an object which you need to cast to your connection pool.
the variable "session" is readily available with JSP Pages..
But in servlet you need to call
requestObject.getSession(true/false)
Hope this helps...
regards
C Balajee
sorry for the inconvinience..
 
Josh Batchelor
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic