use of ru.yandex.clickhouse.ClickHouseDriver in project hetu-core by openlookeng.
the class ClickHouseClientModule method createConnectionFactory.
@Provides
@Singleton
public static ConnectionFactory createConnectionFactory(BaseJdbcConfig config, ClickHouseConfig clickHouseConfig) {
Properties connectionProperties = basicConnectionProperties(config);
connectionProperties.setProperty(ClickHouseConnectionSettings.SOCKET_TIMEOUT.getKey(), String.valueOf(clickHouseConfig.getSocketTimeout()));
return new DriverConnectionFactory(new ClickHouseDriver(), config.getConnectionUrl(), Optional.ofNullable(config.getUserCredentialName()), Optional.ofNullable(config.getPasswordCredentialName()), connectionProperties);
}
Aggregations