[Java]Do we need connection pool if we only use 1 connection?
I would like to ask, if I am going to use a single connection in the whole program, do I need to use a connection pool? Does using a connection pool give me better performance? For example, I may open a static connection and use it for multiple sql query, then fina开发者_运维知识库lly when the program finish, I close the connection. Most of the program I am dealing with, are not multi-threaded, so I don't see the benefit of using connection pool in such situation. Would anyone can answer my question, thank you.
Thanks in advance.
For example, I may open a static connection and use it for multiple sql query, then finally when the program finish, I close the connection. Most of the program I am dealing with, are not multi-threaded
Sounds like you don't need a connection pool.
You don't ever need a connection pool.
It can be useful if you require enforcement on having a limit number of connections.
精彩评论