Updated on 2024-08-10 GMT+08:00

Configuring ClickHouse Connection Properties

Set connection properties in the examples of creating connections in the ClickhouseJDBCHaDemo, Demo, NativeJDBCHaDemo, and Util files. The following code sets the socket timeout interval to 60 seconds:

ClickHouseProperties clickHouseProperties = new ClickHouseProperties();
clickHouseProperties.setSocketTimeout(60000);

If sslUsed in the clickhouse-example.properties configuration file in Importing and Configuring ClickHouse Sample Projects is set to true, set the following connection properties in the examples for creating connections in the ClickhouseJDBCHaDemo, Demo, NativeJDBCHaDemo, and Util files:

clickHouseProperties.setSsl(true);
clickHouseProperties.setSslMode("none");