@Test
  public void testShowGrant() throws SQLException {
    Statement stmt = con.createStatement();
    stmt.execute("grant select on table " + dataTypeTableName + " to user hive_test_user");
    stmt.execute("show grant user hive_test_user on table " + dataTypeTableName);

    ResultSet res = stmt.getResultSet();
    assertTrue(res.next());
    assertEquals("default", res.getString(1));
    assertEquals(dataTypeTableName, res.getString(2));
    assertEquals("", res.getString(3));     // partition
    assertEquals("", res.getString(4));     // column
    assertEquals("hive_test_user", res.getString(5));
    assertEquals("USER", res.getString(6));
    assertEquals("SELECT", res.getString(7));
    assertEquals(false, res.getBoolean(8)); // grant option
    assertEquals(-1, res.getLong(9));
    assertNotNull(res.getString(10));       // grantor
    assertFalse(res.next());
    res.close();
  }
Read the results locally. Then reset the read position to start and read the
rows again verify that we get the same results next time.
@param sqlStmt - SQL statement to execute
@param colName - columns name to read
@param oneRowOnly -  read and compare only one row from the resultset
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/cbo_rp_TestJdbcDriver2.java