jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcUtil.java
public Set<String> getReferredTables(Connection connection, String schema, String tableName) throws SQLException {
    DatabaseMetaData metadata = connection.getMetaData();

    ResultSet result = metadata.getImportedKeys(getCatalog(connection, schema), schema, tableName);
    Set<String> referredTables = new HashSet<>();
    while (result.next()) {
      referredTables.add(result.getString(PK_TABLE_NAME));
    }
    return referredTables;
  }
public Set<String> getReferredTables(Connection connection, String schema, String tableName) throws SQLException {
    DatabaseMetaData metadata = connection.getMetaData();

    ResultSet result = metadata.getImportedKeys(getCatalog(connection, schema), schema, tableName);
    Set<String> referredTables = new HashSet<>();
    while (result.next()) {
      referredTables.add(result.getString(PK_TABLE_NAME));
    }
    return referredTables;
  }
public Set < String > getReferredTables ( Connection connection , String schema , String tableName ) throws SQLException { DatabaseMetaData metadata = connection . getMetaData ( ) ; ResultSet result = metadata . getImportedKeys ( getCatalog ( connection , schema ) , schema , tableName ) ; Set < String > referredTables = new HashSet <> ( ) ; while ( result . next ( ) ) { referredTables . add ( result . getString ( PK_TABLE_NAME ) ) ; } return referredTables ; }
Wrapper for {@link java.sql.DatabaseMetaData#getImportedKeys(String, String, String)}

@param connection An open JDBC connection
@param tableName table name that is optionally fully qualified with a schema in the form schema.tableName
@return List of Table Names whose primary key are referred as foreign key by the table tableName

@throws SQLException
Wrapper for { @link java . sql . DatabaseMetaData#getImportedKeys ( String String String ) }