@Override
  void execute() throws HiveMetaException {
    System.out.println("Create catalog " + catName + " at location " + location);

    Connection conn = schemaTool.getConnectionToMetastore(true);
    boolean success = false;
    try {
      conn.setAutoCommit(false);
      try (Statement stmt = conn.createStatement()) {
        // If they set ifNotExists check for existence first, and bail if it exists.  This is
        // more reliable then attempting to parse the error message from the SQLException.
        if (ifNotExists && catalogExists(stmt)) {
          return;
        }

        int catNum = getNextCatalogId(stmt);
        addCatalog(conn, stmt, catNum);
        success = true;
      }
    } catch (SQLException e) {
      throw new HiveMetaException("Failed to add catalog", e);
    } finally {
      try {
        if (!success) {
          conn.rollback();
        }
      } catch (SQLException e) {
        // Not really much we can do here.
        LOG.error("Failed to rollback, everything will probably go bad from here.", e);
      }
    }
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateCatalog.java