@Test
  public void testShowRoleGrant() throws SQLException {
    Statement stmt = con.createStatement();
    // drop role. ignore error.
    try {
      stmt.execute("drop role role1");
    } catch (Exception ex) {
      LOG.warn("Ignoring error during drop role: " + ex);
    }

    stmt.execute("create role role1");
    stmt.execute("grant role role1 to user hive_test_user");
    stmt.execute("show role grant user hive_test_user");

    ResultSet res = stmt.getResultSet();
    assertTrue(res.next());
    assertEquals("public", res.getString(1));
    assertTrue(res.next());
    assertEquals("role1", res.getString(1));
    res.close();
    stmt.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/TestJdbcDriver2.java