@Test
  public void exampleTest() throws Exception {
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {

      statement.execute("CREATE DATABASE root.sg");
      try (ResultSet resultSet = statement.executeQuery("show databases")) {
        if (resultSet.next()) {
          String storageGroupPath = resultSet.getString(ColumnHeaderConstant.DATABASE);
          Assert.assertEquals("root.sg", storageGroupPath);
        } else {
          Assert.fail("This ResultSet is empty.");
        }
      }
    }
  }
This is an example for integration test.
integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java