Instantiation of Connection object
1 posts in topic
Flat View  Flat View

Posted By:   Rekha_Andrews
Posted On:   Friday, July 5, 2002 02:56 AM

Is it advisable to instantiate Connection

object in a static block

Re: Instantiation of Connection object

Posted By:   Bozidar_Dangubic  
Posted On:   Friday, July 5, 2002 04:20 AM

well, this depends on your design. overall, the answer is probably no. but if you have a single static Connection object that all objects of the class are using for database stuff, then it is ok given of course that access to that variable is synchronized. as I said, overall the answer to your question is probably no so you should look into other design possibilities that do not incur as much trouble as this one.
About | Sitemap | Contact