File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes How to use connectionpooling for a datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to use connectionpooling for a datasource" Watch "How to use connectionpooling for a datasource" New topic

How to use connectionpooling for a datasource

Ben Klug
Ranch Hand

Joined: Jan 28, 2002
Posts: 45

I have a datasource in WAS51 defined and I want to use the connection pooling. how do I have to write the code?

- get the inital context, the datasource and the connection each time required
- keep the context and get the datasource and the connction every time
- keep the datasource and get the connection everytime or
- keep the connection

what is the best way to do it? do I have to close the connection after each execution or is this managed by the server?

emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
What sort of application is this for? If its a web application, would you persist the context, datasource, or connection for multiple requests? The initial context is used for a lookup of the datasource. The datasource is a connection factory interface implemented by the vendor (IBM) to enable connection pooling, persisting that isn't useful either. And if you want to get a connection from the pool, why would you want to hang on to a connection? My understanding is very rudimentary, but I would suggest option 1 (feel free to correct me).
I agree. Here's the link:
subject: How to use connectionpooling for a datasource
It's not a secret anymore!