@Test
  public void testCreateExistDatabase2() throws Exception {
    try (final Connection connection = EnvFactory.getEnv().getConnection();
        final Statement statement = connection.createStatement()) {
      statement.execute("create database root.db");

      try {
        statement.execute("create database root.db.`device`");
        fail();
      } catch (final SQLException e) {
        Assert.assertEquals(
            TSStatusCode.DATABASE_ALREADY_EXISTS.getStatusCode()
                + ": root.db has already been created as database",
            e.getMessage());
      }
    }
  }
Test the parent node has been set as a database
integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateDatabaseIT.java