Vince -

Take a look at the encryption provider[1]. You wouldn't be using it as
intended, but it think it could do the trick.

You'll need to implement the
org.apache.openjpa.lib.encryption.EncryptionProvider interface and whenever
.decrypt(...) is called, go find your properties file and return the
password String value.

Let us know how it goes.

Thanks,
Rick

[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_encryption

On Tue, May 29, 2012 at 8:16 AM, vinbr88 <vinb...@googlemail.com> wrote:

> Hello,
>
> my application is using the persistence.xml for connecting to our Oracle
> test database. The password is inserted there like this:
>
> <properties>
>        <property name="openjpa.ConnectionDriverName"
>                value="oracle.jdbc.driver.OracleDriver" />
>        <property name="openjpa.ConnectionURL"
>                value="jdbc:oracle:thin:@XX.XXX.XXX.XXX:XXXX:DBNAME " />
>        <property name="openjpa.ConnectionUserName" value="ADMIN" />
>        <property name="openjpa.ConnectionPassword" value="test" />
> </properties>
>
> On the target system, the database password changes every 90 days. The
> system automatically creates a property file for every user on the Linux
> file system with his new password in there. Our applications read and use
> the password of this property file on the file system.
>
> Is there a possibility to use this file for connecting to the database via
> openJPA/Oracle JDBC driver. Or do you know a possibility to import the
> password of the property file into the persistence.xml?
>
> Thank you in advance.
>
> Vince
>
>
> --
*Rick Curtis*

Reply via email to