Updated on 2024-04-29 GMT+08:00

Creating a Database

Function Description

Run the on cluster statement to create a database whose name is the value of databaseName of clickhouse-example.properties in the cluster.

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);
}