Should I use a network hub or network switch?

Solution 1:

With just two devices, a hub is sufficient.

When you have just two machines to connect, why the network device? go point-to-point.
I am guessing you want to connect more devices later.
Collisions will matter at that time then (and you cannot go PtP then either).

These days switches and hubs do not have a lot of cost differential.
You might in fact get a switch faster and for about the same price.
Anyway, you have the answer.

Solution 2:

I think with just two devices, a cable is sufficient. If none of the devices has Auto-MDIX you'll need a crossover cable.

Solution 3:

If you've only got two devices, why not just use a crossover cable? Some ports will even auto-switch Rx & Tx in hardware, meaning you could just use a plain old CAT-5 cable. It's worth trying that first; you may not need to buy anything.