persistence@glassfish.java.net

Re: setting persistence.xml property programmatically

From: Tom Ware <tom.ware_at_oracle.com>
Date: Mon, 19 Feb 2007 11:53:25 -0500

Hi Sud,

  The persistence.xml properties can be set in several places. They can
be set in the persistence.xml, in the Map that is given as an argument
to createEntityManagerFactory(), and (in TopLink Essentials), as a Java
System Property.

  The recommended way to set these properties programatically is to use
the Map argument to createEntityMangerFactory().

-Tom

sud wrote:

> I'm using toplink in an Java SE with an embedded database. Is it
> possible to set the properties in the persistence.xml
> programmatically? In particular the location of the embedded database
> in the toplink.jdbc.url property.
>
> Thanks
> -sud
>
> ------------------------------------------------------------------------
> Any questions? Get answers on any topic at Yahoo! Answers
> <http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx>.
> Try it now.