I'm currently working on creating a small shopping cart. I was wondering which method is better to select all my products in one go and storing them as objects or continually selecting them from the database when needed? This is in Java by the way

Thanks in advance