code: public static List<Catalog> getCatalogs(@NonNull final MetadataContext context, final boolean nonempty)
              throws SQLException {
          final List<Catalog> catalogs = context.getCatalogs();
          if (catalogs.isEmpty() && nonempty) {
              final Catalog catalog = new Catalog();
              catalog.virtual = true;
              catalog.setTableCat("");
              catalogs.add(catalog);
              if (!context.isSuppressionPath("catalog/schemas")) {
                  catalog.getSchemas().addAll(context.getSchemas(catalog.getTableCat(), ""));
              }
          }
          if (!context.isSuppressionPath("catalog/schemas")) {
              boolean allempty = true;
              for (final Catalog catalog : catalogs) {
                  if (!catalog.getSchemas().isEmpty()) {
                      allempty = false;
                      break;
                  }
              }
              if (allempty) {
                  logger.warning("schemas are all empty");
                  for (final Catalog catalog : catalogs) {
                      catalog.getSchemas().addAll(getSchemas(context, catalog.getTableCat(), true));
                  }
              }
          }
          return catalogs;
      }
docs: Invokes {@link #getCatalogs()} on given context.
  
  @param context  the context
  @param nonempty a flag for adding a virtual instances if non retrieved.
  @return a list of catalogs
  @throws SQLException if a database error occurs.