@AfterClass
  public static void tearDownAfterClass() throws Exception {
    Statement stmt = con.createStatement();
    // drop test db and its tables and views
    stmt.execute("set hive.support.concurrency = false");
    stmt.execute("drop database if exists " + testDbName + " cascade");
    stmt.close();
    con.close();
    Path cmRootPath = new Path("cmroot");
    Path cmQualPath = FileUtils.makeQualified(cmRootPath, conf);
    cmQualPath.getFileSystem(conf).delete(cmQualPath, true);
  }
TestJdbcDriver2
This class tests the JDBC API for HiveServer2 via an embedded HiveServer2 instance
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java