Statistics statistics = session.getSessionFactory().getStatistics();
Runtime runtime = Runtime.getRuntime();
Collectors collectors = new Collectors(Arrays.asList(new HibernateStatisticsCollector(statistics), new RuntimeStatisticsCollector(runtime)));
collectStatistics(collectors);
C3P0PooledDataSource c3p0PooledDataSource = new C3P0PooledDataSource();
result.include("maxPoolSize", c3p0PooledDataSource.getMaxPoolSize());
result.include("initPoolSize", c3p0PooledDataSource.getInitialPoolSize());