@Test
  public void setAutoCommitOnClosedConnection() throws Exception {
    Connection mycon = getConnection("", "");
    try {
      mycon.setAutoCommit(true);
      mycon.close();
      thrown.expect(SQLException.class);
      thrown.expectMessage("Connection is closed");
      mycon.setAutoCommit(true);
    } finally {
      mycon.close();
    }
  }
Test getting query log when HS2 disable logging.

@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java