Should database connections be singleton?



Should database connections be singleton?..

Answer / Harikrishan Prajapati

Yes, it is a common practice to make database connections singletons in Java because they are expensive resources that should be reused instead of creating new ones unnecessarily.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are three ways in which a thread can enter the waiting state in java programming?

1 Answers  


What is run-time class and system class? what is their purpose?

1 Answers  


What is a ?

1 Answers  


What is string variable?

1 Answers  


Why are the destructors for base class and derived class called in reverse order when the program exits

1 Answers   HCL,


Explain the difference between serializable and externalizable in java?

1 Answers  


What are the names of interfaces that doesn't consists of method/s ?

3 Answers  


Can Java be said to be the complete object-oriented programming language

1 Answers  


What are the benefits of immutable objects?

1 Answers  


suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?

3 Answers  


What is boolean keyword in java?

1 Answers  


How do I get 64 bit java?

1 Answers  


Categories