File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Datasource 4 Datasource 5 in WebSphere5

 
Srinivas Rao Marri
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using datasource 4 in websphere5, which will take default userid and password along with jndi name. In my program i can directly lookup the jndi and access database data without giving any credential(userid, password) details.

My web application using servlet filters, which is not able to connect to datasource 4 because of servlet version 2.3.

If i want to connect to new datasource 5, is there any way where i can give default userid and password like how we did in datasource 4.

I hope in datasource 4 server is taking care of encrypting the credential details. I am looking for similar feature in datasource 5, instead of providing userid/passwd in properties file in an encrypted form.

Regards
Srinivas
 
Brian Hennessy
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
For WAS and WebSPhere Studio the same methods apply.

For version 5 Datasources you need to create a j2c authentication alias , in here you'll specify your username and password. In the admin console =>Security=>JAAS configuration =>J2C Authentication Data.

Then when you create the datasource there are two options Component-managed Authentication Alias/Container Managed Authentication. Depending on the way you have written your app you can select the j2c alias you have created earlier from the drop downs lists for these two options. In a Network deployment environment I've had to restart WebSphere to successfully test the Datasource connection (don't know why). This set up is important especially if you're using XA datasources.

As for how the password are stored I don't think they are encrypted , I think they may be encoded using base 64 encoding and written to the secuirty.xml file. So really you should be locking down access to this file on your WAS environment.

Hope this helps
[ June 09, 2006: Message edited by: hennesb hennesb ]
 
Srinivas Rao Marri
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply. I have some queries here:

1. For J2C authentication alias do we need to give database userid/password??

2. After defining alias, i used container managed option for the datasource5, and i tried to execute a JSP by connecting to database using this datasource, i am getting the below given exception:

com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurre
d while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is java.lang.Exception: Attempted
to use a 5.0 DataSource outside of a 2.3 servlet]

Regards
Srinivas
 
Brian Hennessy
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi


1. For J2C authentication alias do we need to give database userid/password?? Yes if your database has a username and password you supply the values in here.

2. In your web.xml are you referencing the XML DTD for the Servlet 2.2 deployment descriptor

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic