// use default from settings if nothing else specified.
catalog = catalog!=null ? catalog : settings.getDefaultCatalogName();
schema = schema!=null ? schema : settings.getDefaultSchemaName();
JDBCReader reader = JDBCReaderFactory.newJDBCReader(cfg.getProperties(),settings,revengStrategy, cfg.getServiceRegistry());
DatabaseCollector dbs = new MappingsDatabaseCollector(mappings, reader.getMetaDataDialect());
reader.readDatabaseSchema(dbs, catalog, schema);
return dbs;
}