openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinbr88 <vinb...@googlemail.com>
Subject Re: Get database password for persistence.xml from external file
Date Wed, 13 Jun 2012 07:16:49 GMT
Hi,

I didn't try the Encryption Provider method, but the map method solved my
problem:

Map<String, String> dbProperties = new HashMap<String, String>();

dbProperties.put("openjpa.ConnectionUserName", dbUserName);
dbProperties.put("openjpa.ConnectionPassword", dbPassword);

EntityManagerFactory factory =
Persistence.createEntityManagerFactory(ENTITY_MANAGER_FACTORY,
dbProperties);

Here you can find an example:
http://foobar.lu/wp/2010/12/30/change-jpa-entitymanager-connection-properties-at-runtime/

Thank you all for your help.

--
View this message in context: http://openjpa.208410.n2.nabble.com/Get-database-password-for-persistence-xml-from-external-file-tp7579412p7580268.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message