Describing it in more detail, he adds, He came therefore to a city of Samaria, i.e., of the region of Samaria, called Sychar. This Sychar is the same as Shechem. Genesis (33:18) says that Jacob camped near here and that two of his sons, enraged at the rape of Dinah, Jacob's daughter, by the son of the king of Shechem, killed all the males in that city. And so Jacob took possession of the city, and he lived there and dug many wells. Later, as he lay dying, he gave the land to his son Joseph: "I am giving you a portion more than your brothers" (Gn 48:22). And this is what he says: near the plot ...of land which Jacob had given to his son Joseph.
The Evangelist is so careful to record all these matters in order to show us that all the things which happened to the patriarchs were leading up to Christ, and that they pointed to Christ, and that he descended from them according to the flesh.
Source: Commentary on John