I think you might be able to help him reach his own solution if you try the process outlined in How to Talk So Kids Will Listen, and Listen So Kids Will Talk. If it's not already in your parenting library, I recommend it enthusiastically. This is a book you'll reach for often, because it works for all sorts of common behavioral situations.
Briefly, what the book would recommend is that you empathize with your son's predicament. Let him know that you understand that he's probably embarrassed and uncomfortable when he wets himself at school. Don't go overboard with sympathy, just acknowledge how he must feel, and ask for his correction if you get his feelings wrong.
Then ask what he can do himself to deal with it, or what you can do to support his efforts. Write everything he says down in a list – give all his ideas dignity. Don't discount anything; just write. Add your own ideas as you go. Between you, the list may become quite brilliant and original.
After you get a good list, go through it together and cross out ideas that probably won't work. He will probably have one or two ideas left that he'll be willing to try. These may have to do with practical things he can do at school, like using the boys' room between each class, or things he'd like to see happen at home, like more attention from you, or more appreciation for ______, or an adjustment in some other family dynamic.
The beauty of this approach is that it supports and respects the child, gives him a chance to problem-solve in a more adult way, and reduces the pressure on him to succeed your way. The result is often not only success with the outstanding problem, but a new level of maturity. And the underlying "reasons" don't have to be spelled out in detail, just help your son find a pathway to success that works.
My best to you all.