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?
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
subject: How to handle transactions when two different databases are involved.