• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Spring database config security

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to use Spring framework for dataSource configuration but have a requirement to not store any passwords in clear text.

Is there a way for Spring to handle this, or for me to handle this by subclassing something, so it unencrypts the password given in the config file before attempting to establish the database connection?

Snippet:
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could extend the


class which allows you to load configuration values from a property file. I think all you would need to do is override the method



to retrieve the value from the property file and decrypt. Then in your xml config add the following bean (replace the class with your extended classes)



Then create the property file



Another option would be investigate configuring the DataSource within your J2EE server and using JNDI to access the datasource.

regards

Jason

[ March 09, 2006: Message edited by: Jason Moors ]
[ March 09, 2006: Message edited by: Jason Moors ]
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic