Help Center/
CloudTable Service/
Developer Guide/
ClickHouse Application Development Guide/
Development Process/
Sample Code/
Creating a Database
Updated on 2024-11-28 GMT+08:00
Creating a Database
Function Description
In the following example, the on cluster statement is used to create a database on all Server nodes in the cluster.
The database name is specified by the databaseName field in the clickhouse-example.properties file.
Sample Code
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: Sample Code
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