JPA: create EntityManagerFactory from properties
i am using JPA in a JAR-Project and used the persistence.xml to setup my EntityManager. But since the persistence.xml is inside the JAR after the build it is very complicated for the user to change the settings afterwards. So i'm looking for a solution where i can configure my connection over a propertyfile which is loaded at runtime. I came across this solution on the web: Map properties = new HashMap(); // Configure the internal EclipseLink connection pool properties.put(JDBC_DRIVER, "oracle.jdbc.OracleDriver"); properties.put(JDBC_URL, "jdbc:oracle:thin:@localhost:1521:ORCL"); properties