【问题标题】:c3p0 connection pooling, DataSources factory, how do I close the pool?c3p0 连接池,DataSources 工厂,如何关闭池?
【发布时间】:2015-08-23 03:27:38
【问题描述】:

我正在尝试使用C3P0 与 PostgreSQL 和 SQLite 进行连接池。 PostgreSQL 端工作没问题。我有followed the directions here,但我不明白当我完成后如何关闭 SQLite 的一面。

换句话说,在我使用ComboPooledDataSource 的PostgreSQL 端,我可以在ComboPooledDataSource 上调用.close(),如图here 所示。我觉得 SQLite 方面也应该有一个 .close(),但我在 DataSource 上没有看到一个。

如何适当地关闭 SQLite 端?我还需要吗?

【问题讨论】:

    标签: java postgresql sqlite connection-pooling c3p0


    【解决方案1】:

    来自DataSources.pooledDataSourcejavadoc:

    如果您对池统计信息感兴趣,@return 可以转换为 {@link PooledDataSource} 的 DataSource

    PooledDataSourceclose 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      • 2012-09-29
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      相关资源
      最近更新 更多