users@glassfish.java.net

Re: is it possible to use JPA without that persistence.xml file?

From: <glassfish_at_javadesktop.org>
Date: Wed, 05 Aug 2009 10:30:48 PDT

You can override the connection properties in persistence.xml by hand, by setting some provider-specific properties.

http://forums.java.net/jive/message.jspa?messageID=269950

In fact you don't want your persitence.xml file to hold user names or passwords. You usually deliver it within an ear without that information, and then you set some properties in a Map and use EntityManager.createEntityManager( themap) to retrieve a working EntityManager.
[Message sent by forum member 'vieiro' (vieiro)]

http://forums.java.net/jive/thread.jspa?messageID=359038