use of com.zaxxer.hikari.HikariDataSource in project opentheso by miledrousset.
the class TestRecursive 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", "frantiq2014");
config.addDataSourceProperty("databaseName", "pactols");
config.addDataSourceProperty("portNumber", "5432");
config.addDataSourceProperty("serverName", "pactols.frantiq.fr");
// Zoomathia
/* config.addDataSourceProperty("user", "opentheso");
config.addDataSourceProperty("password", "opentheso");
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("portNumber", "5432");
config.addDataSourceProperty("user", "pactols");
config.addDataSourceProperty("password", "frantiq2014");
config.addDataSourceProperty("databaseName", "193.48.137.33");
*/
// 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.HikariDataSource in project opentheso by miledrousset.
the class TestRestService method testGetInvertPathConcept.
/**
* permet de retourner les concepts d'une branche à l'envers(en partant du concept jusqu'au concept TT)
*/
@org.junit.Test
public void testGetInvertPathConcept() {
ArrayList<String> path = new ArrayList<>();
ArrayList<ArrayList<String>> tabId = new ArrayList<>();
String idTheso = "TH_1";
String idConcept = "150082";
HikariDataSource conn = openConnexionPool();
ConceptHelper conceptHelper = new ConceptHelper();
path.add(idConcept);
tabId = conceptHelper.getPathOfConceptWithoutGroup(conn, idConcept, idTheso, path, tabId);
ExportFromBDD exportFromBDD = new ExportFromBDD();
exportFromBDD.setServerArk("http://ark.frantiq.fr/ark:/");
exportFromBDD.setServerAdress("http://pactols.frantiq.fr/");
StringBuffer skos = exportFromBDD.exportConceptByLot(conn, idTheso, tabId);
if (skos == null)
System.out.println("");
else
System.err.println(skos.toString());
conn.close();
}
use of com.zaxxer.hikari.HikariDataSource in project opentheso by miledrousset.
the class NewEmptyJUnitTest method openConnexionPool.
private HikariDataSource openConnexionPool() {
HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(1000);
config.setConnectionTestQuery("SELECT 1");
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
config.setMinimumIdle(1);
config.setAutoCommit(true);
config.setIdleTimeout(30000);
config.setConnectionTimeout(30000);
config.addDataSourceProperty("portNumber", "5433");
config.addDataSourceProperty("user", "opentheso");
config.addDataSourceProperty("password", "opentheso");
config.addDataSourceProperty("databaseName", "OTW2");
config.addDataSourceProperty("serverName", "localhost");
HikariDataSource poolConnexion1 = new HikariDataSource(config);
return poolConnexion1;
}
use of com.zaxxer.hikari.HikariDataSource in project opentheso by miledrousset.
the class NewEmptyJUnitTest method apple.
// TODO add test methods here.
// The methods must be annotated with annotation @Test. For example:
//
@Test
public void apple() throws SQLException {
HikariDataSource conn = openConnexionPool();
recuperatefils(conn);
}
use of com.zaxxer.hikari.HikariDataSource in project opentheso by miledrousset.
the class TestExportPrivatesDatas method testWriteUsersIntoXML1.
@Test
public void testWriteUsersIntoXML1() {
HikariDataSource conn = openConnexionPool();
ExportPrivatesDatas exportPrivatesDatas = new ExportPrivatesDatas();
ArrayList<Table> usersList = exportPrivatesDatas.getDatasOfTable(conn, "alignement_type");
// ArrayList <Proposition> listPropo = exportPrivatesDatas.getProposition(conn);
// ArrayList <Concept_Candidat> listConceptC = exportPrivatesDatas.getconceptCandidat(conn);
// ArrayList <Term_Candidat> listTermC = exportPrivatesDatas.getTermeCandidat(conn);
// ArrayList <Concept_orphan> list_userRol = exportPrivatesDatas.getConceptOrphelin(conn);
// ArrayList <Concept_Fusion> list_userRol = exportPrivatesDatas.getconceptFusion(conn);
// ArrayList <Images> list_userRol = exportPrivatesDatas.getImages(conn);
// ArrayList <Preferences> list_userRol = exportPrivatesDatas.getPreferences(conn);
// ArrayList <Concept_Group_Historique> list_userRol = exportPrivatesDatas.getConceptGroupHist(conn);
// ArrayList <Concept_Group_Label_Historique> list_userRol = exportPrivatesDatas.getconceptGroupLabelH(conn);
// ArrayList <Concept_Historique> list_userRol = exportPrivatesDatas.getConceptHistorique(conn);
// ArrayList <Hierarchical_Relationship_Historique> list_userRol = exportPrivatesDatas.getHierarchicalRelationshipH(conn);
// ArrayList <Non_Preferred_Term> list_userRol = exportPrivatesDatas.getNonPreferredTerm(conn);
// ArrayList <Note_Historique> list_userRol = exportPrivatesDatas.getNoteHistorique(conn);
// ArrayList <Term_Historique> list_userRol = exportPrivatesDatas.getTermHistorique(conn);
conn.close();
writeHead();
startTable("users");
for (Table user : usersList) {
startLine();
for (LineOfData lineOfData : user.getLineOfDatas()) {
writeLine(lineOfData.getColomne(), lineOfData.getValue());
}
endLine();
}
endTable("users");
System.out.println(xml);
}
Aggregations