Example usage for org.apache.commons.dbcp2 PoolingDataSource close

List of usage examples for org.apache.commons.dbcp2 PoolingDataSource close

Introduction

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

Prototype

@Override
public void close() throws Exception 

Source Link

Document

Close and free all Connection s from the pool.

Usage

From source file:hu.neuron.java.jdbc.PoolingDataSourceExample.java

public static void shutdownDataSource() throws SQLException {
    PoolingDataSource<PoolableConnection> bds = (PoolingDataSource<PoolableConnection>) dataSource;
    try {/*ww w  .jav a2 s.c  o m*/
        bds.close();
        connectionPool.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}