Example usage for org.apache.commons.dbcp2.datasources SharedPoolDataSource close

List of usage examples for org.apache.commons.dbcp2.datasources SharedPoolDataSource close

Introduction

In this page you can find the example usage for org.apache.commons.dbcp2.datasources SharedPoolDataSource close.

Prototype

@Override
public void close() throws Exception 

Source Link

Document

Close pool being maintained by this datasource.

Usage

From source file:org.lightmare.jpa.datasource.dbcp.InitDBCP.java

@Override
public void cleanUp(DataSource dataSource) {

    SharedPoolDataSource pooledDataSource;
    if (dataSource instanceof SharedPoolDataSource) {
        try {// w ww  .  j a v  a  2 s  . c  o  m
            pooledDataSource = ObjectUtils.cast(dataSource, SharedPoolDataSource.class);
            pooledDataSource.close();
        } catch (Exception ex) {
            LOG.error(InitMessages.COULD_NOT_CLOSE_ERROR.message, ex);
        }
    }
}