This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
You need to use distributed (global) transactions. I have no idea if this is possible without an EJB server but, even if it is, this is one case where the set up and operation would be so much easier with such a server. An EJB server would, amongst other things, bootstrap the XA resources into a it's transaction manager, manage the connection pools via the data sources and manage the global transactions.
You will need to use XA drivers, XA-configured databases and data sources enabled for global transactions. Is there a suitable driver for MySQL?