I have terrible cramps while and after swimming?

Today was my very first day of my new swim class, and I had to swim a lot, more than I ever have. In the middle, I started having a stomach ache. It would stop in the middle of swimming and start again while I was resting. When I got out, it became worse and at one point I could barely walk, it usually stops while I’m sitting and hurt most when walking and standing up. Anyone know how to prevent this??
Answers

Lyar

While swimming, you're using nearly every muscle in your body all at once, so naturally it's going to be rough on your body if you haven't swam in a long while. I'd suggest eating a banana in the morning before a class too to keep your potassium up.