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?
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).