Connecting to ClickHouse with Java

In this example we will be using the official Java client maintained by the ClickHouse team. 

Dependencies 

Add the dependencies below to your project 

For tarball installation:

Java Code 

Use this code below to build connections to the nodes and try executing a SELECT query on the cluster 

Simply replace the password of the icclickhouse user with that from the Connection Info page. The isrgrootx1.pem file is also available for downloading from the same page on the console.  

By Instaclustr Support
Need Support?
Experiencing difficulties on the website or console?
Already have an account?
Need help with your cluster?
Contact Support
Why sign up?
To experience the ease of creating and managing clusters via the Instaclustr Console
Spin up a cluster in minutes