public Response createDatabase(String user, DatabaseDesc desc)
    throws HcatException, NotAuthorizedException, BusyException,
    ExecuteException, IOException {
    String exec = "create database";
    if (desc.ifNotExists)
      exec += " if not exists";
    exec += " " + desc.database;
    if (TempletonUtils.isset(desc.comment))
      exec += String.format(" comment '%s'", desc.comment);
    if (TempletonUtils.isset(desc.location))
      exec += String.format(" location '%s'", desc.location);
    if (TempletonUtils.isset(desc.properties))
      exec += String.format(" with dbproperties (%s)",
        makePropertiesStatement(desc.properties));
    exec += ";";

    String res = jsonRun(user, exec, desc.group, desc.permissions);
    return JsonBuilder.create(res)
      .put("database", desc.database)
      .build();
  }
Create a database with the given name
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java