public void setPort(final int port) { if (port > 0) { connectionProperties.put(PORT, String.valueOf(port)); } else { LOGGER.log(Level.WARNING, new StringFormat("Cannot connect to port, %d", port)); } }
private void logOverride(final String inclusionRuleName, final InclusionRule schemaInclusionRule) { LOGGER .log(Level.INFO, new StringFormat("Overriding %s inclusion rule from command-line to %s", inclusionRuleName, schemaInclusionRule)); }
private void logOverride(final String inclusionRuleName, final InclusionRule schemaInclusionRule) { LOGGER .log(Level.INFO, new StringFormat("Overriding %s inclusion rule from command-line to %s", inclusionRuleName, schemaInclusionRule)); }
@Override public Reader openNewInputReader(final Charset charset) throws IOException { requireNonNull(charset, "No input charset provided"); if (!exists(inputFile)) { return new StringReader(""); } final Reader reader = newBufferedReader(inputFile, charset); LOGGER.log(Level.INFO, new StringFormat("Opened input reader to file <%s>", inputFile)); return new InputReader(getDescription(), reader, true); }
public static InfoLevel valueOfFromString(final String infoLevelValue) { try { return InfoLevel.valueOf(infoLevelValue); } catch (final IllegalArgumentException | NullPointerException e) { LOGGER.log(Level.INFO, new StringFormat("Unknown infolevel <%s>", infoLevelValue)); return unknown; } }
public static InfoLevel valueOfFromString(final String infoLevelValue) { try { return InfoLevel.valueOf(infoLevelValue); } catch (final IllegalArgumentException | NullPointerException e) { LOGGER.log(Level.INFO, new StringFormat("Unknown infolevel <%s>", infoLevelValue)); return unknown; } }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }
RetrieverConnection(final Connection connection, final SchemaRetrievalOptions schemaRetrievalOptions) throws SQLException { this.connection = checkConnection(connection); metaData = connection.getMetaData(); this.schemaRetrievalOptions = requireNonNull(schemaRetrievalOptions, "No database specific overrides provided"); LOGGER.log(Level.CONFIG, new StringFormat("%s", schemaRetrievalOptions)); tableTypes = new TableTypes(connection); LOGGER.log(Level.CONFIG, new StringFormat("Supported table types are <%s>", tableTypes)); javaSqlTypes = new JavaSqlTypes(); }
public static long executeForLong(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForLong(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static ResultSet executeAgainstSchema(final Query query, final Statement statement, final InclusionRule schemaInclusionRule) throws SQLException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, schemaInclusionRule); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static ResultSet executeAgainstSchema(final Query query, final Statement statement, final InclusionRule schemaInclusionRule) throws SQLException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, schemaInclusionRule); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }
private void analyzeTables() { if (tables.isEmpty()) { return; } final Collection<String> prefixes = findTableNamePrefixes(tables); mapTableNameMatches(tables, prefixes); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, new StringFormat("Table prefixes=%s", prefixes)); LOGGER.log(Level.FINE, new StringFormat("Table matches map: %s", ObjectToString.toString(tableKeys))); } }
public static long executeForLong(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForLong(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static ResultSet executeAgainstTable(final Query query, final Statement statement, final Table table, final boolean isAlphabeticalSortForTableColumns, final Identifiers identifiers) throws SQLException { requireNonNull(query, "No query provided"); requireNonNull(identifiers, "No identifiers provided"); final String sql = getQuery(query, table, isAlphabeticalSortForTableColumns, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }
public static ResultSet executeAgainstTable(final Query query, final Statement statement, final Table table, final boolean isAlphabeticalSortForTableColumns, final Identifiers identifiers) throws SQLException { requireNonNull(query, "No query provided"); requireNonNull(identifiers, "No identifiers provided"); final String sql = getQuery(query, table, isAlphabeticalSortForTableColumns, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }
public static boolean isGraphvizJavaAvailable(final GraphOutputFormat graphOutputFormat) { final String className = "guru.nidi.graphviz.engine.Graphviz"; final boolean hasClass = Utility.isClassAvailable(className); final boolean supportsFormat = canMap(graphOutputFormat); LOGGER.log(Level.INFO, new StringFormat("Checking if diagram can be generated - " + " can load <%s> = <%b>, " + " can generate format <%s> = <%b>", className, hasClass, graphOutputFormat.getDescription(), supportsFormat)); return hasClass && supportsFormat; }