public Database getDatabase(String dbName) throws HiveException {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.HIVE_GET_DATABASE);
    try {
      return getMSC().getDatabase(dbName);
    } catch (NoSuchObjectException e) {
      return null;
    } catch (Exception e) {
      throw new HiveException(e);
    } finally {
      perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.HIVE_GET_DATABASE, "HS2-cache");
    }
  }
Get the database by name.
@param dbName the name of the database.
@return a Database object if this database exists, null otherwise.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java