I've seen a lot questions like this, but none of them has an answer I need. I have created a prepared statement which will update my table Tickets. Now to the method buyTickets() I give parameters of CustomerId (knr), PerformanceId(aid) and No. of Ticekts to buy (anzTickets). I have to loop through my Query and for every ticket (number of wanted tickets - anzTickets) I have to call prepared Statement. But I got an error which says that ResultSet is not properly positioned. I'm not really sure where and how to call next() so that preparedStatement can be executed in each row? Here is my code :I've seen a lot questions like this, but none o