@Override
  public void dropDatabase(String dbName, boolean ifExists, DropDBMode mode)
    throws HCatException {
    boolean isCascade = mode.toString().equalsIgnoreCase("cascade");
    try {
      hmsClient.dropDatabase(checkDB(dbName), true, ifExists, isCascade);
    } catch (NoSuchObjectException e) {
      if (!ifExists) {
        throw new ObjectNotFoundException(
          "NoSuchObjectException while dropping db.", e);
      }
    } catch (InvalidOperationException e) {
      throw new HCatException(
        "InvalidOperationException while dropping db.", e);
    } catch (MetaException e) {
      throw new HCatException("MetaException while dropping db.", e);
    } catch (TException e) {
      throw new ConnectionFailureException("TException while dropping db.",
        e);
    }
  }
The HCatClientHMSImpl is the Hive Metastore client based implementation of
HCatClient.
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/HCatClientHMSImpl.java