Modify persistence.xml on runtime
问题 I'm developping a program that uses JPA, and I deployed it in a single jar. I wish to modify (or ask to the user, in an menú item) the configuration of the connection data with the database server. It's possible to modify the data (user, password, ip) of the server "on the fly"? (I apologize my bad english) 回答1: The JPA spec doesn't allow for dynamic modification of persistence-units. Some implementations may provide an implementation-specific way of defining a persistence-unit dynamically.