public boolean databaseExists(String dbName) throws HiveException {
    return getDatabase(dbName) != null;
  }
Query metadata to see if a database with the given name already exists.

@param dbName
@return true if a database with the given name already exists, false if
        does not exist.
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java