Setting Up a Connection
Function Description
During connection creation, the user and password configured in clickhouse-example.properties are used as authentication credentials. ClickHouse performs security authentication on the server with the user and password.
Sample Code
ClickHouseDataSource clickHouseDataSource =new ClickHouseDataSource(JDBC_PREFIX + serverList.get(tries - 1), clickHouseProperties); connection = clickHouseDataSource.getConnection(user, password);
There will be huge security risks if the passwords used for authentication are directly written into the code. You are advised to store the password in ciphertext in the configuration file or environment variables and decrypt them when using them.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot