public Response listDatabases(String user, String dbPattern)
    throws HcatException, NotAuthorizedException, BusyException,
    ExecuteException, IOException {
    String exec = String.format("show databases like '%s';", dbPattern);
    try {
      String res = jsonRun(user, exec);
      return JsonBuilder.create(res)
        .build();
    } catch (HcatException e) {
      throw new HcatException("unable to show databases for: " + dbPattern,
        e.execBean, exec);
    }
  }
Return a json "show databases like".  This will return a list of
databases.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java