use different database with entitymanagerfactory code example
Example: use different database with entitymanagerfactory
EntityManagerFactory emf1 = Persistence.createEntityManagerFactory("source-1");
EntityManagerFactory emf2 = Persistence.createEntityManagerFactory("source-2");