For getting data from remote url which connection type will work fast URLConnection or Socket.
Presumably you mean the java "URLConnection" library versus or raw Sockets.
As URL connection uses sockets internally then logically sockets should a little bit faster as http makes all the socket calls plus some overhead in handling the full protocol.
In practice I would expect very little difference. If you code up your own sockets interface you will need to do most the extra processing carried out by the URL connection in order to make the sockets connection workable and reliable.
Also the java "URLConnection" library was probably written by programmers who are better than you or I. Certainly 10 years on most of the bugs have been found. So why not take advantage of that skill and experience and use the simpler URLConnection.