Search in sources :

Example 1 with JdbcConnection

use of util.JdbcConnection in project infinispan by infinispan.

the class AbstractSQLStoreFunctionalTest method getDatabases.

protected static HashMap<DatabaseType, JdbcConnection> getDatabases() {
    Objects.requireNonNull(JDBC_URL);
    Objects.requireNonNull(JDBC_USERNAME);
    Objects.requireNonNull(JDBC_PASSWORD);
    Objects.requireNonNull(DATABASE);
    List<DatabaseType> databaseTypes = Arrays.stream(DATABASE.split(",")).map(DatabaseType::guessDialect).collect(Collectors.toList());
    HashMap<DatabaseType, JdbcConnection> map = new HashMap<>();
    for (int i = 0; i < databaseTypes.size(); i++) {
        String jdbcURL = JDBC_URL.split(",")[i];
        String username = JDBC_USERNAME.split(",")[i];
        String password = JDBC_PASSWORD.split(",")[i];
        JdbcConnection jdbcConnection = new JdbcConnection(jdbcURL, username, password);
        DatabaseType databaseType = databaseTypes.get(i);
        map.put(databaseType, jdbcConnection);
    }
    return map;
}
Also used : DatabaseType(org.infinispan.persistence.jdbc.common.DatabaseType) HashMap(java.util.HashMap) JdbcConnection(util.JdbcConnection)

Aggregations

HashMap (java.util.HashMap)1 DatabaseType (org.infinispan.persistence.jdbc.common.DatabaseType)1 JdbcConnection (util.JdbcConnection)1