Help Center/
MapReduce Service/
Developer Guide (Normal_3.x)/
ClickHouse Development Guide (Security Mode)/
Developing a ClickHouse Application/
Creating a ClickHouse Database
Updated on 2024-10-23 GMT+08:00
Creating a ClickHouse Database
This section describes the sample code for creating a ClickHouse database.
The following code snippet is provided in the createDatabase method of the Demo class in the com.huawei.clickhouse.examples package.
Run the on cluster statement to create a database whose name is the value of databaseName in Table 1 in the cluster.
private void createDatabase(String databaseName, String clusterName) throws Exception { String createDbSql = "create database if not exists " + databaseName + " on cluster " + clusterName; util.exeSql(createDbSql); }
Parent topic: Developing a ClickHouse Application
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot