@Test
  public void testPreparedStatementCloseOnCompletion() throws SQLException {
    PreparedStatement stmt = con.prepareStatement("select under_col from " + tableName + " limit 1");
    stmt.closeOnCompletion();
    ResultSet res = stmt.executeQuery();
    assertTrue(res.next());
    assertFalse(stmt.isClosed());
    assertFalse(res.next());
    assertFalse(stmt.isClosed());
    res.close();
    assertTrue(stmt.isClosed());
  }
Test {@link HiveStatement#executeAsync(String)} for an insert overwrite into a table
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java