If i write a Singleton class for obtaining a Database connection . Assume that there are 100 Usrs accessing the Application , and if one user closes the connection , for the other 99 users will the connection would be closed or not ??
I don't understand the connection to "other users". Aren't they all calling getConnection() themselves? If so, this gives them a separate connection.
In this case the Singleton class is used for obtaining Database connection form COnnection Pooling .
so there will be only one instance of the Object and if one user closes the doesn't it close other user connections ??
Now as per my knowledge i understand that if one User needs to get only one Databse connection , then singleton is applicable there .
Means one connection per one User , but not for the Entire Application .