What is the benefit of Connection and Statement Pooling?

后端 未结 5 1456
青春惊慌失措
青春惊慌失措 2020-12-05 00:44

Can someone explain what is Connection and Statement Pooling and what is the benefit over unpooled DataSources? I am trying to understand when it is a good idea to use a tec

5条回答
  •  孤街浪徒
    2020-12-05 01:16

    Creating a network connection to a database server is (relatively) expensive. Likewise asking the server to prepare a SQL statement is (relatively) expensive.

    Using a connection/statement pool, you can reuse existing connections/prepared statements, avoiding the cost of initiating a connection, parsing SQL etc.

提交回复
热议问题