开发者

Which is better: JDBC Connection pooling, or using SIngleton class for JDBC Connection?

We already have a web application (medium sized) which involves a lot of Database operations.

We have to change the existing 开发者_运维知识库code which is really affecting the performance of the application. As of now for each database connection new connection is made and then closed.

To improve performance in JDBC, which would be better:

  1. JDBC connction pooling
  2. Singleton class having JDBC implementation

We are using MySQL database.


Well, a singleton class would only give you one connection presumably. If you have a lot of database operations, you don't want to serialise them that way, especially since a decent database, and hopefully your web application, is more than capable of running lots of concurrent operations.

Pooling would be better.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜