C3P0DatasourceAccessor implements DatasourceAccessor { @Override public DataSourceInfo getInfo(Object resource) throws Exception { DataSourceInfo dataSourceInfo = null; if (canMap(resource)) { ComboPooledDataSource source = (ComboPooledDataSource) resource; dataSourceInfo = new DataSourceInfo(); dataSourceInfo.setBusyConnections(source.getNumBusyConnections()); dataSourceInfo.setEstablishedConnections(source.getNumConnections()); dataSourceInfo.setMaxConnections(source.getMaxPoolSize()); dataSourceInfo.setJdbcUrl(source.getJdbcUrl()); dataSourceInfo.setUsername(source.getUser()); dataSourceInfo.setResettable(true); dataSourceInfo.setType("c3p0"); } return dataSourceInfo; }  @Override DataSourceInfo getInfo(Object resource); @Override boolean reset(Object resource); @Override boolean canMap(Object resource);  }
@Test public void getInfoTest() throws Exception { accessor.getInfo(source); }