aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes JNDI-programatically set the password on datasource defined in the appcontext.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI-programatically set the password on datasource defined in the appcontext.xml" Watch "JNDI-programatically set the password on datasource defined in the appcontext.xml" New topic
Author

JNDI-programatically set the password on datasource defined in the appcontext.xml

Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

Hi fellow ranchers,

for my project,i am using WAS 6.1.0.25 server.my application uses mybatis and spring3.x and struts 2 as well.

now i have configured the datasource on WAS and provided the datasource bean as below:


we cannot store the password in the App server(in WAS we can store it as a custom property). It is coming from a java application. PwdGen.java which has a method .I have to set the database pwd using this method. can i set it before i make the get connection() call? the problem here is that the datasource is injected in the application. so how can i handle this scenario ? How will i programmatically set the password on the datasource and make the datasource available for the entire application?



Regards,Vinny M.
proud Fan of European Champion CHELSEA FC
"If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling
Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

i solved this problem by using my custom DataSourceAdapter. now the password is not stored anywhere in the custom property of the app server.
 
jQuery in Action, 2nd edition
 
subject: JNDI-programatically set the password on datasource defined in the appcontext.xml