code: public static Catalog crawlDatabase(final Connection connection, final InclusionRule schemaRule, final InclusionRule tableRule) throws SchemaCrawlerException {
          final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.builder()
                  .withSchemaInfoLevel(SchemaInfoLevelBuilder.standard().setRetrieveIndexes(false))
                  .routineTypes(Arrays.asList(RoutineType.procedure, RoutineType.unknown))
                  .includeSchemas(schemaRule == null ? new IncludeAll() : schemaRule)
                  .includeTables(tableRule == null ? new IncludeAll() : tableRule)
                  .toOptions();
  
          try {
              return SchemaCrawlerUtility.getCatalog(connection, options);
          } catch (SchemaCrawlerException e) {
              LOG.error("Schema crawling failed with exception", e);
              throw e;
          }
      }
docs: Starts the schema crawler and lets it crawl the given JDBC connection.
  
  @param connection The JDBC connection
  @param schemaRule The {@link InclusionRule} to be passed to SchemaCrawler that specifies which schemas should be analyzed
  @param tableRule  The {@link InclusionRule} to be passed to SchemaCrawler that specifies which tables should be analyzed. If a table is included by the
  {@code tableRule} but excluded by the {@code schemaRule} it will not be analyzed.
  @return The populated {@link Catalog} object containing the metadata for the extractor
  @throws SchemaCrawlerException Gets thrown when the database could not be crawled successfully