Help Center/ MapReduce Service/ Developer Guide (Normal_3.x)/ ClickHouse Development Guide (Security Mode)/ Developing a ClickHouse Application/ Setting Up a ClickHouse Connection
Updated on 2025-10-23 GMT+08:00
Setting Up a ClickHouse Connection
This section describes the sample code for creating a ClickHouse connection.
The following code snippets are provided in the initConnection method of the ClickhouseJDBCHaDemo class.
During connection creation, the user and password configured in Table 1 are used as authentication credentials. ClickHouse performs security authentication on the server with the user and password.
clickHouseProperties.setPassword(userPass); clickHouseProperties.setUser(userName); BalancedClickhouseDataSource balancedClickhouseDataSource = new BalancedClickhouseDataSource(JDBC_PREFIX + UriList, clickHouseProperties);
Parent topic: Developing a ClickHouse Application
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.