我想问一下,如果我要在整个程序中使用单个连接,是否需要使用连接池?使用连接池是否可以提供更好的性能? 例如,我可能会打开一个静态连接并将其用于多个sql查询,然后最后当程序完成时,我关闭连接。我正在处理的大多数程序都不是多线程的,因此我没有看到在这种情况下使用连接池的好处。谁能回答一下我的问题,谢谢。
提前致谢。
最佳答案
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
听起来您不需要连接池。
关于java - [Java]如果只使用1个连接,还需要连接池吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5011754/