Creating a database connection pool

前端 未结 7 2075
失恋的感觉
失恋的感觉 2020-12-30 12:48

Need information on creating a connection pool to the database (irrespective of the database) , and how efficient they are? What are the conditions where they can enhance pe

7条回答
  •  独厮守ぢ
    2020-12-30 13:37

    Using a connection pool, you save time at every access because connection is already established.

    Moreover, at least on Oracle, you keep the compiled statement linked to the connection, so repetitive execution of same SQL statement is even quicker.

    (see PreparedStatement if you are in Java/JDBC)

    The only risk of counter-performance is when you keep too many idle connections in your pool, the associated ressources (your side and on database) are wasted.

提交回复
热议问题