You'd better not do exercise right now since you have corneal ulcer which will bring more invisible bacterium which will make the corneal ulcer get serious. You need to have the good rest for the eyes and use some eye drops with anti-inflammation to get rid of the inner bacterium in the eyes. You should also use the warm compress to make the eyes feel comfortable. This is very effective which you could have a try.
Yes, you can as long as this kind of exercise won't affect your eyes. Doing exercise can improve your overall healthy, blood circulation and immunity. It has benefits for you indirectly, but if the exercise is swimming, you must stop it.
Normal exercise without influence or contacts on eyes is one thing, but swimming is another thing.
There are many dirt, bacteria, fungas, virus, and unknown hazardous substances in swimming pool which may worsen the inflammation in your cornea and stop your eyes from recovery.
Well, in my opinion, you'd better not have exercise when you have corneal ulcers. First, according to some researches, if the clear coating and cornea has been rubbed or irritated, a small tear or cut may occur in your eyes. In that way, corneal ulcers can occur. Because it can make your eyes infected easily, exercises should be avoided, or it can be dangerous for your eyes. What is serious is that sometimes, it may increase the risk of vision loss. To treat it, you can use a cold compress and Ibuprofen to prevent eye pain. Anyway, just be careful about it.