hi i want to know if i use connection pooling where should i establish my db connection is it in init or service if i put in the init since the init is executed onely onece will give me any problems when concurrent uses login to the app or if i have 10 servlets will there any problem in the connection pool with 5 connection avalable.
it would be a big help if anyone can give me any thing
You don't want to get your connection from the init method. The point of a connection pool is to get a connection when you need it and return it to the pool as soon as your done with it.
Personally, I'd avoid getting it from the pool anywhere in the Servlet code itself. You business logic and data access code should be in Plain Old Java Objects that are called from the Servlet. This way that business logic and data access can be reused by other types of clients.
Which app server are u using? If you're using something like WebSphere, all you need to do is configure your JDBC connection and your connection pooling is going to be handled by the app server ... just a thought -stan
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.