How to establish a connection pool in JDBC?

前端 未结 13 2540
一个人的身影
一个人的身影 2020-11-22 02:43

Can anybody provide examples or links on how to establish a JDBC connection pool?

From searching google I see many different ways of doing this and it is rather conf

13条回答
  •  醉梦人生
    2020-11-22 02:56

    Don't reinvent the wheel.

    Try one of the readily available 3rd party components:

    • Apache DBCP - This one is used internally by Tomcat, and by yours truly.
    • c3p0

    Apache DBCP comes with different example on how to setup a pooling javax.sql.DataSource. Here is one sample that can help you get started.

提交回复
热议问题