在程序中更改persistence.xml中的值 [英] Change values in persistence.xml from within the program
本文介绍了在程序中更改persistence.xml中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以从使用它的程序中更改persistence.xml中的值?如果是的话,我将不胜感激一些提示或/和阅读链接.
Is it possible to change values in persistence.xml from within the program that is using it ? If yes, i would appreciate some hints or/and links to read.
推荐答案
是
// connect to database
log.info("Connecting to database @ " + dbUrl + " using " + dbUser + "/" + dbPass);
emf = Persistence.createEntityManagerFactory("manager", Maps.create(
"javax.persistence.jdbc.user", dbUser,
"javax.persistence.jdbc.password", dbPass,
"javax.persistence.jdbc.url", dbUrl
));
这篇关于在程序中更改persistence.xml中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文