Java Desktop Applications – switch propertie from a JPA persistent unit at runtime
HashMap propertiesMap; javax.persistence.EntityManager entityManager; propertiesMap = new HashMap(); propertiesMap.put(“toplink.jdbc.password", “password"); propertiesMap.put(“toplink.jdbc.url", “url"); entityManager = javax.persistence.Persistence.createEntityManagerFactory(“persistencePU", propertiesMap).createEntityManager();