Howdy I want to know what is the most efficient way to handle DB connections in a large and high traffic web app.
Currently I m using a DriverManager connection to execute DB queries and updates.
This *single* connection was created in my context listener and I m using it through out the application for all components to use.
I still haven't published the web app to the internet yet so I haven't fully tested it out..
I want to know what are the pros and cons of using my current method and would I get connection pooling? also if there is a better way to handle this issue.
my code looks like:
[ December 05, 2008: Message edited by: Eric Damps ]
Eric, This would not give you connection pooling - you need multiple connections for that. Connection pooling is critical for large apps. See DBCP for an open source one.
Thanks Jeanne, Probably I'd be using DataSource instead.
I've got another question about my current implementation. Can this single connection be used by more than one user at a time concurrently or is it synchronized? note that I'm actually establishing a connection to the DB before bounding the Conn. object into the context, and later just getting the Conn. object and use it to query DB. [ December 06, 2008: Message edited by: Eric Damps ]