JavaBean and database connection
1 posts in topic
Flat View  Flat View

Posted By:   sarah_chi
Posted On:   Thursday, August 8, 2002 06:22 PM

I am new to JavaBean and trying to work on a web project with database in the back end.

Should I always initiate a database connection when a new bean gets initiate or I should test to see if the connection object still alive, before I initiage a database connection for the new bean?

Thanks very much.

Re: JavaBean and database connection

Posted By:   Horatiu_Ripa  
Posted On:   Friday, August 30, 2002 04:39 AM

Is not quite a good policy to keep the DB connection alive. Anyway, if you choose that, you should keep the "connection alive" within a session scope object (bean).

A better policy is to open/perform DB operations/close the DB connection in any of the paged scope beans.

On pooled connection drivers/DB's is definitely the best approach.
About | Sitemap | Contact