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 packet.
private void createDatabase(String databaseName, String clusterName) throws Exception {
String createDbSql = "create database if not exists " + databaseName + " on cluster " + clusterName;
util.exeSql(createDbSql);
}
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.