use of com.zaxxer.hikari.HikariConfig in project opentheso by miledrousset.
the class Soap method openConnexionPool.
private HikariDataSource openConnexionPool(Properties properties) {
HikariConfig config = new HikariConfig();
config.setMinimumIdle(Integer.parseInt(properties.getProperty("minimumIdle")));
config.setMaximumPoolSize(Integer.parseInt(properties.getProperty("setMaximumPoolSize")));
config.setAutoCommit(true);
config.setIdleTimeout(Integer.parseInt(properties.getProperty("idleTimeout")));
config.setConnectionTimeout(Integer.parseInt(properties.getProperty("connectionTimeout")));
config.setConnectionTestQuery(properties.getProperty("connectionTestQuery"));
config.setDataSourceClassName(properties.getProperty("dataSourceClassName"));
config.addDataSourceProperty("user", properties.getProperty("dataSource.user"));
config.addDataSourceProperty("password", properties.getProperty("dataSource.password"));
config.addDataSourceProperty("databaseName", properties.getProperty("dataSource.databaseName"));
config.addDataSourceProperty("serverName", properties.getProperty("dataSource.serverName"));
config.addDataSourceProperty("portNumber", properties.getProperty("dataSource.serverPort"));
HikariDataSource poolConnexion1 = new HikariDataSource(config);
try {
Connection conn = poolConnexion1.getConnection();
if (conn == null)
return null;
conn.close();
} catch (SQLException ex) {
Logger.getLogger(Connexion.class.getName()).log(Level.SEVERE, null, ex);
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_FATAL, ex.getClass().getName(), ex.getMessage());
FacesContext.getCurrentInstance().addMessage(null, message);
poolConnexion1.close();
return null;
}
return poolConnexion1;
}
use of com.zaxxer.hikari.HikariConfig in project opentheso by miledrousset.
the class GetAllArkTest method openConnexionPool.
private HikariDataSource openConnexionPool() {
HikariConfig config = new HikariConfig();
config.setMinimumIdle(1);
config.setMaximumPoolSize(1000);
config.setConnectionTestQuery("SELECT 1");
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
/* config.addDataSourceProperty("user", "opentheso");
config.addDataSourceProperty("password", "opentheso");
config.addDataSourceProperty("databaseName", "OTW");
*/
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "pactols");
config.addDataSourceProperty("databaseName", "pactols");
// config.addDataSourceProperty("serverName", "localhost");
config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("serverName", "localhost");
// config.addDataSourceProperty("serverName", "193.48.137.88");
HikariDataSource poolConnexion1 = new HikariDataSource(config);
return poolConnexion1;
}
use of com.zaxxer.hikari.HikariConfig in project opentheso by miledrousset.
the class ConnexionTest method openConnexionPool.
private HikariDataSource openConnexionPool() {
HikariConfig config = new HikariConfig();
config.setMinimumIdle(1);
config.setMaximumPoolSize(100);
config.setConnectionTestQuery("SELECT 1");
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
// Zoomathia
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "pactols");
config.addDataSourceProperty("databaseName", "pactols");
config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("serverName", "localhost");
/* config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "pactols");
config.addDataSourceProperty("databaseName", "OTW");
*/
/*
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "frantiq2014");
config.addDataSourceProperty("databaseName", "pactols");
// config.addDataSourceProperty("serverName", "localhost");
/*config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("serverName", "localhost");
// config.addDataSourceProperty("serverName", "193.48.137.88");
*/
HikariDataSource poolConnexion1 = new HikariDataSource(config);
return poolConnexion1;
}
use of com.zaxxer.hikari.HikariConfig in project opentheso by miledrousset.
the class ImportNotesTest method openConnexionPool.
private HikariDataSource openConnexionPool() {
HikariConfig config = new HikariConfig();
config.setMinimumIdle(1);
config.setMaximumPoolSize(100);
config.setConnectionTestQuery("SELECT 1");
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
// Zoomathia
/* config.addDataSourceProperty("user", "opentheso");
config.addDataSourceProperty("password", "opentheso");
config.addDataSourceProperty("databaseName", "zoo");
config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("serverName", "localhost");
*/
/* config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "pactols");
config.addDataSourceProperty("databaseName", "OTW");
*/
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "frantiq2014");
config.addDataSourceProperty("databaseName", "pactols_test");
config.addDataSourceProperty("portNumber", "5432");
config.addDataSourceProperty("serverName", "pactols2.mom.fr");
// config.addDataSourceProperty("serverName", "localhost");
/*config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("serverName", "localhost");
// config.addDataSourceProperty("serverName", "193.48.137.88");
*/
HikariDataSource poolConnexion1 = new HikariDataSource(config);
return poolConnexion1;
}
use of com.zaxxer.hikari.HikariConfig in project opentheso by miledrousset.
the class TestExportTabulate method openConnexionPool.
private HikariDataSource openConnexionPool() {
HikariConfig config = new HikariConfig();
config.setMinimumIdle(1);
config.setMaximumPoolSize(1000);
// config.setJdbc4ConnectionTest(false);
config.setConnectionTestQuery("SELECT 1");
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
/* config.addDataSourceProperty("user", "opentheso");
config.addDataSourceProperty("password", "opentheso");
config.addDataSourceProperty("databaseName", "OTW");
*/
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "frantiq2014");
config.addDataSourceProperty("databaseName", "pactols");
// config.addDataSourceProperty("serverName", "localhost");
config.addDataSourceProperty("portNumber", "5432");
config.addDataSourceProperty("serverName", "opentheso.mom.fr");
// config.addDataSourceProperty("serverName", "193.48.137.88");
HikariDataSource poolConnexion1 = new HikariDataSource(config);
return poolConnexion1;
}
Aggregations