.getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.PRIMARY_KEYS))
.getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.PRIMARY_KEYS))
.getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.INDEXES))
.getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.INDEXES))
private void retrieveProcedureColumnsFromDataDictionary(final NamedObjectList<MutableRoutine> allRoutines, final InclusionRuleFilter<ProcedureColumn> columnFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews .hasQuery(InformationSchemaKey.PROCEDURE_COLUMNS)) { throw new SchemaCrawlerSQLException("No procedure columns SQL provided", null); } final Query procedureColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.PROCEDURE_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(procedureColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveProcedureColumnsFromDataDictionary"); while (results.next()) { createProcedureColumn(results, allRoutines, columnFilter); } } }
private void retrieveFunctionColumnsFromDataDictionary(final NamedObjectList<MutableRoutine> allRoutines, final InclusionRuleFilter<FunctionColumn> columnFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FUNCTION_COLUMNS)) { throw new SchemaCrawlerSQLException("No function columns SQL provided", null); } final Query functionColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.FUNCTION_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(functionColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveFunctionColumnsFromDataDictionary"); while (results.next()) { createFunctionColumn(results, allRoutines, columnFilter); } } }
private void retrieveFunctionColumnsFromDataDictionary(final NamedObjectList<MutableRoutine> allRoutines, final InclusionRuleFilter<FunctionColumn> columnFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FUNCTION_COLUMNS)) { throw new SchemaCrawlerSQLException("No function columns SQL provided", null); } final Query functionColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.FUNCTION_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(functionColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveFunctionColumnsFromDataDictionary"); while (results.next()) { createFunctionColumn(results, allRoutines, columnFilter); } } }
private void retrieveTableColumnsFromDataDictionary(final NamedObjectList<MutableTable> allTables, final InclusionRuleFilter<Column> columnFilter, final Set<List<String>> hiddenColumns) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.TABLE_COLUMNS)) { throw new SchemaCrawlerSQLException("No table columns SQL provided", null); } final Query tableColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.TABLE_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(tableColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveTableColumnsFromDataDictionary"); while (results.next()) { createTableColumn(results, allTables, columnFilter, hiddenColumns); } } }
private void retrieveProcedureColumnsFromDataDictionary(final NamedObjectList<MutableRoutine> allRoutines, final InclusionRuleFilter<ProcedureColumn> columnFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews .hasQuery(InformationSchemaKey.PROCEDURE_COLUMNS)) { throw new SchemaCrawlerSQLException("No procedure columns SQL provided", null); } final Query procedureColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.PROCEDURE_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(procedureColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveProcedureColumnsFromDataDictionary"); while (results.next()) { createProcedureColumn(results, allRoutines, columnFilter); } } }
private void retrieveTableColumnsFromDataDictionary(final NamedObjectList<MutableTable> allTables, final InclusionRuleFilter<Column> columnFilter, final Set<List<String>> hiddenColumns) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.TABLE_COLUMNS)) { throw new SchemaCrawlerSQLException("No table columns SQL provided", null); } final Query tableColumnsSql = informationSchemaViews .getQuery(InformationSchemaKey.TABLE_COLUMNS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(tableColumnsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveTableColumnsFromDataDictionary"); while (results.next()) { createTableColumn(results, allTables, columnFilter, hiddenColumns); } } }
.getInformationSchemaViews(); if (!informationSchemaViews .hasQuery(InformationSchemaKey.EXT_HIDDEN_TABLE_COLUMNS))
private void retrieveForeignKeysFromDataDictionary() throws SchemaCrawlerSQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FOREIGN_KEYS)) { LOGGER.log(Level.FINE, "Extended foreign keys SQL statement was not provided"); return; } final NamedObjectList<MutableForeignKey> foreignKeys = new NamedObjectList<>(); final Query fkSql = informationSchemaViews .getQuery(InformationSchemaKey.FOREIGN_KEYS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(fkSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveForeignKeysUsingSql"); createForeignKeys(results, foreignKeys); } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve foreign keys from SQL:\n" + fkSql, e); } }
private void retrieveForeignKeysFromDataDictionary() throws SchemaCrawlerSQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FOREIGN_KEYS)) { LOGGER.log(Level.FINE, "Extended foreign keys SQL statement was not provided"); return; } final NamedObjectList<MutableForeignKey> foreignKeys = new NamedObjectList<>(); final Query fkSql = informationSchemaViews .getQuery(InformationSchemaKey.FOREIGN_KEYS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(fkSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveForeignKeysUsingSql"); createForeignKeys(results, foreignKeys); } catch (final SQLException e) { throw new SchemaCrawlerSQLException("Could not retrieve foreign keys from SQL:\n" + fkSql, e); } }
private void retrieveProceduresFromDataDictionary(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Procedure> procedureFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.PROCEDURES)) { throw new SchemaCrawlerSQLException("No procedures SQL provided", null); } final Query proceduresSql = informationSchemaViews .getQuery(InformationSchemaKey.PROCEDURES); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(proceduresSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveProceduresFromDataDictionary"); int numProcedures = 0; while (results.next()) { numProcedures = numProcedures + 1; createProcedure(results, schemas, procedureFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d procedures", numProcedures)); } }
private void retrieveFunctionsFromDataDictionary(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Function> functionFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FUNCTIONS)) { throw new SchemaCrawlerSQLException("No functions SQL provided", null); } final Query functionsSql = informationSchemaViews .getQuery(InformationSchemaKey.FUNCTIONS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(functionsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveFunctionsFromDataDictionary"); int numFunctions = 0; while (results.next()) { numFunctions = numFunctions + 1; createFunction(results, schemas, functionFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d functions", numFunctions)); } }
if (!informationSchemaViews.hasQuery(InformationSchemaKey.SCHEMATA))
private void retrieveProceduresFromDataDictionary(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Procedure> procedureFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.PROCEDURES)) { throw new SchemaCrawlerSQLException("No procedures SQL provided", null); } final Query proceduresSql = informationSchemaViews .getQuery(InformationSchemaKey.PROCEDURES); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(proceduresSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveProceduresFromDataDictionary"); int numProcedures = 0; while (results.next()) { numProcedures = numProcedures + 1; createProcedure(results, schemas, procedureFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d procedures", numProcedures)); } }
private void retrieveFunctionsFromDataDictionary(final NamedObjectList<SchemaReference> schemas, final InclusionRuleFilter<Function> functionFilter) throws SQLException { final InformationSchemaViews informationSchemaViews = getRetrieverConnection() .getInformationSchemaViews(); if (!informationSchemaViews.hasQuery(InformationSchemaKey.FUNCTIONS)) { throw new SchemaCrawlerSQLException("No functions SQL provided", null); } final Query functionsSql = informationSchemaViews .getQuery(InformationSchemaKey.FUNCTIONS); final Connection connection = getDatabaseConnection(); try (final Statement statement = connection.createStatement(); final MetadataResultSet results = new MetadataResultSet(functionsSql, statement, getSchemaInclusionRule());) { results.setDescription("retrieveFunctionsFromDataDictionary"); int numFunctions = 0; while (results.next()) { numFunctions = numFunctions + 1; createFunction(results, schemas, functionFilter); } LOGGER.log(Level.INFO, new StringFormat("Processed %d functions", numFunctions)); } }
if (!informationSchemaViews.hasQuery(InformationSchemaKey.TABLES))
if (!informationSchemaViews.hasQuery(InformationSchemaKey.TABLES))