You could have both - a sand jar and a litter tray/potty. You can get little plastic corner potties that fit in a corner of a house
This size is good
https://www.amazon.co.uk/Hamster-cor...=hamster+potty
I'd be a bit careful with the jar and keep an eye on it -if it tips up your hammy may get trapped in it. Maybe Cypher meant a cookie jar type thing which sits at an angle.