// create a driver connection factory
Properties properties = new Properties();
properties.setProperty("user", "username");
properties.setProperty("password", "password");
ConnectionFactory connectionFactory = new DriverConnectionFactory(new TesterDriver(), "jdbc:apache:commons:testdriver", properties);
// wrap it with a LocalXAConnectionFactory
XAConnectionFactory xaConnectionFactory = new LocalXAConnectionFactory(transactionManager, connectionFactory);
// create the pool object factory