kmort
kmort

Reputation: 2938

c3p0 connection pooling, DataSources factory, how do I close the pool?

I'm trying to use C3P0 for connection pooling with both PostgreSQL and SQLite. The PostgreSQL side works no problem. I've followed the directions here, but I don't understand how to close the SQLite side down when I'm done with it.

In other words, on the PostgreSQL side, where I'm using a ComboPooledDataSource, I can call .close() on my ComboPooledDataSource as shown here. I feel like there should be a .close() for the SQLite side too, but I don't see one on the DataSource.

How do I close down the SQLite side appropriately? Do I even need to?

Upvotes: 0

Views: 633

Answers (1)

user3707125
user3707125

Reputation: 3484

From DataSources.pooledDataSource javadoc:

@return a DataSource that can be cast to a {@link PooledDataSource} if you are interested in pool statistics

And PooledDataSource has close method.

Upvotes: 1

Related Questions