code: public static boolean getConnectedComponents(Connection connection,
                                                   String inputTable,
                                                   String orientation) throws SQLException {
          KeyedGraph graph = prepareGraph(connection, inputTable, orientation, null,
                  VUCent.class, Edge.class);
          if (graph == null) {
              return false;
          }
          final List<Set<VUCent>> componentsList = getConnectedComponents(graph, orientation);
  
          final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable);
          final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODE_COMP_SUFFIX);
          final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGE_COMP_SUFFIX);
  
          if (storeNodeConnectedComponents(connection, nodesName, edgesName, componentsList)) {
              if (storeEdgeConnectedComponents(connection, tableName, nodesName, edgesName)) {
                  return true;
              }
          }
          return false;
      }
docs: Calculate the node and edge connected component tables.
  
  @param connection  Connection
  @param inputTable  Edges table produced by ST_Graph
  @param orientation Orientation string
  @return True if the calculation was successful
  @throws SQLException