Spring DriverManagerDataSource vs apache BasicDataSource

后端 未结 2 1068
小蘑菇
小蘑菇 2021-02-05 07:38

What is the difference between Spring DriverManagerDataSource and apache BasicDataSource? Which of them is preferable and in which situations?

Thank you.

2条回答
  •  青春惊慌失措
    2021-02-05 07:44

    From Spring DriverManagerDataSource API:

    This class is not an actual connection pool; it does not actually pool Connections. It just serves as simple replacement for a full-blown connection pool, implementing the same standard interface, but creating new Connections on every call.

    In other words, it may be OK for tests but in real application use Apache DBCP

提交回复
热议问题