Search in sources :

Example 1 with OracleExecutor

use of com.hortonworks.registries.storage.impl.jdbc.provider.oracle.factory.OracleExecutor in project registry by hortonworks.

the class QueryExecutorFactory method get.

public static QueryExecutor get(String type, Map<String, Object> dbProperties) {
    HikariCPConnectionBuilder connectionBuilder = getHikariCPConnnectionBuilder(dbProperties);
    ExecutionConfig executionConfig = getExecutionConfig(dbProperties);
    QueryExecutor queryExecutor = null;
    switch(type) {
        case "mysql":
            queryExecutor = new MySqlExecutor(executionConfig, connectionBuilder);
            break;
        case "postgresql":
            queryExecutor = new PostgresqlExecutor(executionConfig, connectionBuilder);
            break;
        case "oracle":
            queryExecutor = new OracleExecutor(executionConfig, connectionBuilder);
            break;
        default:
            throw new IllegalArgumentException("Unsupported storage provider type: " + type);
    }
    return queryExecutor;
}
Also used : HikariCPConnectionBuilder(com.hortonworks.registries.storage.impl.jdbc.connection.HikariCPConnectionBuilder) MySqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor) PostgresqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.postgresql.factory.PostgresqlExecutor) QueryExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.QueryExecutor) OracleExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.oracle.factory.OracleExecutor) ExecutionConfig(com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig)

Aggregations

ExecutionConfig (com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig)1 HikariCPConnectionBuilder (com.hortonworks.registries.storage.impl.jdbc.connection.HikariCPConnectionBuilder)1 MySqlExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor)1 OracleExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.oracle.factory.OracleExecutor)1 PostgresqlExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.postgresql.factory.PostgresqlExecutor)1 QueryExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.QueryExecutor)1