/** * Initialize and create new Data Source * @return data source */ private static HikariDataSource initialize() throws Exception { DatabaseCredentials credentials = Loader.getSettings().getDatabaseCredentials(); HikariConfig config = DBPoolConf.getHikariConfig(credentials); return new HikariDataSource(config); }
/** * Initialize and create new Data Source * @return data source */ private static HikariDataSource initialize() throws Exception { DatabaseCredentials credentials = Loader.getSettings().getDatabaseCredentials(); HikariConfig config = DBPoolConf.getHikariConfig(credentials); return new HikariDataSource(config); }
/** * Initialize and create new Data Source * @return data source */ private static HikariDataSource initialize() throws Exception { DatabaseCredentials credentials = Loader.getSettings().getDatabaseCredentials(); HikariConfig config = DBPoolConf.getHikariConfig(credentials); return new HikariDataSource(config); }
public CDREndpoint() { pageLimit = Loader.getSettings().getDatabaseCredentials().getDatabasePageLimit(); }
public UDREndpoint() { pageLimit = Loader.getSettings().getDatabaseCredentials().getDatabasePageLimit(); }
public BillEndpoint() { pageLimit = Loader.getSettings().getDatabaseCredentials().getDatabasePageLimit(); }
static HikariConfig getHikariConfig(DatabaseCredentials c) { Properties props = new Properties(); String URL = String.format("jdbc:postgresql://%s:%d/%s?stringtype=unspecified", c.getDatabaseHost(), c.getDatabasePort(), c.getDatabaseName()); props.setProperty("dataSourceClassName", "org.postgresql.ds.PGSimpleDataSource"); props.setProperty("dataSource.url", URL); props.setProperty("dataSource.serverName", c.getDatabaseHost()); props.setProperty("dataSource.portNumber", Integer.toString(c.getDatabasePort())); props.setProperty("dataSource.user", c.getDatabaseUsername()); props.setProperty("dataSource.password", c.getDatabasePassword()); props.setProperty("dataSource.databaseName", c.getDatabaseName()); // this should be at least 30 seconds lower than underlying database props.setProperty("maxLifetime", "240000"); // set based on concurrency preference (corresponding to data ingestion in RabbitMQ) props.setProperty("maximumPoolSize", String.format("%d", Loader.getSettings().getDatabaseCredentials().getDatabaseConnections())); return new HikariConfig(props); } }
static HikariConfig getHikariConfig(DatabaseCredentials c) { Properties props = new Properties(); String URL = String.format("jdbc:postgresql://%s:%d/%s?stringtype=unspecified", c.getDatabaseHost(), c.getDatabasePort(), c.getDatabaseName()); props.setProperty("dataSourceClassName", "org.postgresql.ds.PGSimpleDataSource"); props.setProperty("dataSource.url", URL); props.setProperty("dataSource.serverName", c.getDatabaseHost()); props.setProperty("dataSource.portNumber", Integer.toString(c.getDatabasePort())); props.setProperty("dataSource.user", c.getDatabaseUsername()); props.setProperty("dataSource.password", c.getDatabasePassword()); props.setProperty("dataSource.databaseName", c.getDatabaseName()); // this should be at least 30 seconds lower than underlying database props.setProperty("maxLifetime", "240000"); // set based on concurrency preference (corresponding to data ingestion in RabbitMQ) props.setProperty("maximumPoolSize", String.format("%d", Loader.getSettings().getDatabaseCredentials().getDatabaseConnections())); return new HikariConfig(props); } }
static HikariConfig getHikariConfig(DatabaseCredentials c) { Properties props = new Properties(); String URL = String.format("jdbc:postgresql://%s:%d/%s?stringtype=unspecified", c.getDatabaseHost(), c.getDatabasePort(), c.getDatabaseName()); props.setProperty("dataSourceClassName", "org.postgresql.ds.PGSimpleDataSource"); props.setProperty("dataSource.url", URL); props.setProperty("dataSource.serverName", c.getDatabaseHost()); props.setProperty("dataSource.portNumber", Integer.toString(c.getDatabasePort())); props.setProperty("dataSource.user", c.getDatabaseUsername()); props.setProperty("dataSource.password", c.getDatabasePassword()); props.setProperty("dataSource.databaseName", c.getDatabaseName()); // this should be at least 30 seconds lower than underlying database props.setProperty("maxLifetime", "240000"); // set based on concurrency preference (corresponding to data ingestion in RabbitMQ) props.setProperty("maximumPoolSize", String.format("%d", Loader.getSettings().getDatabaseCredentials().getDatabaseConnections())); return new HikariConfig(props); } }