先确認我們的ck服務正常,随便做個查詢

<dependency>
<groupId>ru.yandex.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.2.4</version>
</dependency>
jdbc測試
public void clickHouseTest() throws ClassNotFoundException, SQLException {
Class.forName("ru.yandex.clickhouse.ClickHouseDriver");
Connection connection = DriverManager.getConnection("jdbc:clickhouse://*.*.*.*:8123/tutorial", "使用者名", "密碼");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("select count(1) from tutorial.hits_v1");
while (resultSet.next()) {
System.out.println("查詢結果為:" + resultSet.getString(1));
}
}
結果