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 |
What are three ways in which a thread can enter the waiting state in java programming?
What is run-time class and system class? what is their purpose?
What is a ?
What is string variable?
Why are the destructors for base class and derived class called in reverse order when the program exits
Explain the difference between serializable and externalizable in java?
What are the names of interfaces that doesn't consists of method/s ?
Can Java be said to be the complete object-oriented programming language
What are the benefits of immutable objects?
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?
What is boolean keyword in java?
How do I get 64 bit java?