/** * Allows building of database specific options programatically, using * an existing SchemaCrawler database plugin as a starting point. * * @return SchemaRetrievalOptionsBuilder * @throws SchemaCrawlerException * On an exception. */ private static SchemaRetrievalOptionsBuilder buildSchemaRetrievalOptions(final Connection connection) throws SchemaCrawlerException { checkConnection(connection); final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); final DatabaseConnector dbConnector = registry .lookupDatabaseConnector(connection); LOGGER .log(Level.INFO, "Using database plugin for " + dbConnector.getDatabaseServerType()); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = dbConnector .getSchemaRetrievalOptionsBuilder(connection); return schemaRetrievalOptionsBuilder; }
/** * Crawls a database, and returns a catalog. * * @param connection * Live database connection. * @param schemaCrawlerOptions * Options. * @return Database catalog. * @throws SchemaCrawlerException * On an exception. */ public static Catalog getCatalog(final Connection connection, final SchemaCrawlerOptions schemaCrawlerOptions) throws SchemaCrawlerException { checkConnection(connection); if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, ObjectToString.toString(schemaCrawlerOptions)); } final SchemaRetrievalOptions schemaRetrievalOptions = matchSchemaRetrievalOptions(connection); final SchemaCrawler schemaCrawler = new SchemaCrawler(connection, schemaRetrievalOptions, schemaCrawlerOptions); final Catalog catalog = schemaCrawler.crawl(); return catalog; }
/** * Allows building of database specific options programatically, using * an existing SchemaCrawler database plugin as a starting point. * * @return SchemaRetrievalOptionsBuilder * @throws SchemaCrawlerException * On an exception. */ private static SchemaRetrievalOptionsBuilder buildSchemaRetrievalOptions(final Connection connection) throws SchemaCrawlerException { checkConnection(connection); final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); final DatabaseConnector dbConnector = registry .lookupDatabaseConnector(connection); LOGGER .log(Level.INFO, "Using database plugin for " + dbConnector.getDatabaseServerType()); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = dbConnector .getSchemaRetrievalOptionsBuilder(connection); return schemaRetrievalOptionsBuilder; }
/** * Allows building of database specific options programatically, using * an existing SchemaCrawler database plugin as a starting point. * * @return SchemaRetrievalOptionsBuilder * @throws SchemaCrawlerException * On an exception. */ private static SchemaRetrievalOptionsBuilder buildSchemaRetrievalOptions(final Connection connection) throws SchemaCrawlerException { checkConnection(connection); final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); final DatabaseConnector dbConnector = registry .lookupDatabaseConnector(connection); LOGGER .log(Level.INFO, "Using database plugin for " + dbConnector.getDatabaseServerType()); final SchemaRetrievalOptionsBuilder schemaRetrievalOptionsBuilder = dbConnector .getSchemaRetrievalOptionsBuilder(connection); return schemaRetrievalOptionsBuilder; }
/** * Crawls a database, and returns a catalog. * * @param connection * Live database connection. * @param schemaCrawlerOptions * Options. * @return Database catalog. * @throws SchemaCrawlerException * On an exception. */ public static Catalog getCatalog(final Connection connection, final SchemaCrawlerOptions schemaCrawlerOptions) throws SchemaCrawlerException { checkConnection(connection); if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, ObjectToString.toString(schemaCrawlerOptions)); } final SchemaRetrievalOptions schemaRetrievalOptions = matchSchemaRetrievalOptions(connection); final SchemaCrawler schemaCrawler = new SchemaCrawler(connection, schemaRetrievalOptions, schemaCrawlerOptions); final Catalog catalog = schemaCrawler.crawl(); return catalog; }
/** * Crawls a database, and returns a catalog. * * @param connection * Live database connection. * @param schemaCrawlerOptions * Options. * @return Database catalog. * @throws SchemaCrawlerException * On an exception. */ public static Catalog getCatalog(final Connection connection, final SchemaCrawlerOptions schemaCrawlerOptions) throws SchemaCrawlerException { checkConnection(connection); if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, ObjectToString.toString(schemaCrawlerOptions)); } final SchemaRetrievalOptions schemaRetrievalOptions = matchSchemaRetrievalOptions(connection); final SchemaCrawler schemaCrawler = new SchemaCrawler(connection, schemaRetrievalOptions, schemaCrawlerOptions); final Catalog catalog = schemaCrawler.crawl(); return catalog; }