If all three schemas reside in the same database, you might be able (depending on the database) to grant necessary permissions and access all the schemas from a single connection. This way would seem the best to me, as you could completely avoid distributed transactions.
If this is not possible, you'd probably need to use a transaction manager that would coordinate distributed transactions. The details of two-phase commits would be managed by it. To the best of my understanding, most application servers have such a transaction manager. I have no direct experience, but googling up
transaction manager jboss brings up
this.