private Object loadPoolingDataSource(Reference ref) { // If DataSource exists, return it String name = getProperty(ref, "dataSourceName"); PGPoolingDataSource pds = PGPoolingDataSource.getDataSource(name); if (pds != null) { return pds; } // Otherwise, create a new one pds = new PGPoolingDataSource(); pds.setDataSourceName(name); loadBaseDataSource(pds, ref); String min = getProperty(ref, "initialConnections"); if (min != null) { pds.setInitialConnections(Integer.parseInt(min)); } String max = getProperty(ref, "maxConnections"); if (max != null) { pds.setMaxConnections(Integer.parseInt(max)); } return pds; }
private Object loadPoolingDataSource(Reference ref) { // If DataSource exists, return it String name = getProperty(ref, "dataSourceName"); PGPoolingDataSource pds = PGPoolingDataSource.getDataSource(name); if (pds != null) { return pds; } // Otherwise, create a new one pds = new PGPoolingDataSource(); pds.setDataSourceName(name); loadBaseDataSource(pds, ref); String min = getProperty(ref, "initialConnections"); if (min != null) { pds.setInitialConnections(Integer.parseInt(min)); } String max = getProperty(ref, "maxConnections"); if (max != null) { pds.setMaxConnections(Integer.parseInt(max)); } return pds; }
ds.setMaxConnections(Integer.parseInt((String) db.get("perf_maxconnections"))); ds.setServerName((String) db.get("perf_servername")); ds.setPortNumber(Integer.parseInt((String) db.get("perf_port"))); ds.setMaxConnections(Integer.parseInt((String) db.get("config_maxconnections"))); ds.setServerName((String) db.get("config_servername")); ds.setPortNumber(Integer.parseInt((String) db.get("config_port")));
private Object loadPoolingDataSource(Reference ref) { // If DataSource exists, return it String name = getProperty(ref, "dataSourceName"); PGPoolingDataSource pds = PGPoolingDataSource.getDataSource(name); if (pds != null) { return pds; } // Otherwise, create a new one pds = new PGPoolingDataSource(); pds.setDataSourceName(name); loadBaseDataSource(pds, ref); String min = getProperty(ref, "initialConnections"); if (min != null) { pds.setInitialConnections(Integer.parseInt(min)); } String max = getProperty(ref, "maxConnections"); if (max != null) { pds.setMaxConnections(Integer.parseInt(max)); } return pds; }
private Object loadPoolingDataSource(Reference ref) { // If DataSource exists, return it String name = getProperty(ref, "dataSourceName"); PGPoolingDataSource pds = PGPoolingDataSource.getDataSource(name); if (pds != null) { return pds; } // Otherwise, create a new one pds = new PGPoolingDataSource(); pds.setDataSourceName(name); loadBaseDataSource(pds, ref); String min = getProperty(ref, "initialConnections"); if (min != null) { pds.setInitialConnections(Integer.parseInt(min)); } String max = getProperty(ref, "maxConnections"); if (max != null) { pds.setMaxConnections(Integer.parseInt(max)); } return pds; }
nu.setUser(user); nu.setPassword(pass); nu.setMaxConnections(maxConnections); nu.setInitialConnections(initialConnections); nu.initialize();