mcf.setUserName("root");
   private void startManagedConnectionFactory(ObjectName on) throws Exception   {      LocalManagedConnectionFactory mcf = new LocalManagedConnectionFactory();               switch (DB)      {         case (HSQL) :         {            mcf.setConnectionURL("jdbc:hsqldb:mem:test");            mcf.setDriverClass("org.hsqldb.jdbcDriver");            mcf.setUserName("sa");            break;         }         case (MYSQL) :         {            //mysql            mcf.setConnectionURL("jdbc:mysql://localhost:3306/messaging");            mcf.setDriverClass("com.mysql.jdbc.Driver");            mcf.setTransactionIsolation("TRANSACTION_READ_COMMITTED");            break;         }         case (ORACLE) :         {            mcf.setConnectionURL("jdbc:oracle:thin:@localhost:1521/XE");            mcf.setDriverClass("oracle.jdbc.driver.OracleDriver");            mcf.setUserName("messaging");            mcf.setPassword("messaging");            mcf.setTransactionIsolation("TRANSACTION_READ_COMMITTED");            break;         }         default :         {            throw new IllegalStateException("No such DB " + DB);         }      }      ManagedConnectionFactoryJMXWrapper mbean = new ManagedConnectionFactoryJMXWrapper(mcf);      mbeanServer.registerMBean(mbean, on);      mbeanServer.invoke(on, "start", new Object[0], new String[0]);      log.debug("started " + on);   }