@Test
  public void testCreateTableExecAsync() throws Exception {
    HiveStatement stmt = (HiveStatement) con.createStatement();
    String tblName = "testCreateTableExecAsync";
    boolean isResulSet = stmt.executeAsync("create table " + tblName + " (col1 int , col2 string)");
    assertFalse(isResulSet);
    // HiveStatement#getUpdateCount blocks until the async query is complete
    stmt.getUpdateCount();
    DatabaseMetaData metadata = con.getMetaData();
    ResultSet tablesMetadata = metadata.getTables(null, null, "%", null);
    boolean tblFound = false;
    while (tablesMetadata.next()) {
      String tableName = tablesMetadata.getString(3);
      if (tableName.equalsIgnoreCase(tblName)) {
        tblFound = true;
      }
    }
    if (!tblFound) {
      fail("Unable to create table using executeAsync");
    }
    stmt.execute("drop table " + tblName);
    stmt.close();
  }
Test {@link HiveStatement#executeAsync(String)} for a create table
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java