views:

239

answers:

1

We have a batch application using OpenJPA. We are specifying all the DB connection parameters in persistence.xml. Although its a functional setup it looks very insecure to have all the ip,username,password in clear text and a serious concern in production.

As it is a standalone batch app we cant use server configurations etc. Is there a way to may JPA read the properties from an encrypted file...or at the least something like MD5 hashing the parameter values?

+3  A: 

At least passwords can be encrypted. Since OpenJPA 1.3.0 your can set an EncryptionProvider in OpenJPAConfiguration. See also the manual.

Markus Knittig
Thanks Markus. Very helpful. Its a start. Unfortunately we use v1.2. Still I will look into that...maybe there are other improvements also.Looking back, encryption support should have a primary feature, don't you think?
Barun
Well, JPA is still probably mostly used in container environments, so the use case isn't that common. OpenJPA 2.x (aka 1.3) isn't released yet (only the beta), but the new feature (mostly support for JPA 2) look very promising...
Markus Knittig