File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Spring database config security Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "Spring database config security" Watch "Spring database config security" New topic
Author

Spring database config security

Lu Battist
Ranch Hand

Joined: Feb 17, 2003
Posts: 104
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:
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
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 ]
 
 
subject: Spring database config security
 
Threads others viewed
JPA-hibernate-spring config
Generic DAO using Spring
DataAccess using Spring...
Spring - Connection Problem in some Unit Tests
How to configure the datasource using JDBCtemplate (Spring)
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com