You set the use-java-context to true in the db2-ds.xml, so the jndi name of your datasource is java:/DB2DS. Change the lookup parameter to "java:/DB2DS", it will work.
Thanks for your reply. I made the change but I am still getting the same exception.
Jithu mada wrote:
I need to lookup a datasource defined in Jboss from a standalone Java program.
Since you are looking up from a standlaone program, you won't be able to use the datasource without changing the configuration. See this for details http://community.jboss.org/wiki/HowCanIAccessADataSourceFromAClient. You can then use "DB2DS" as the jndi name for the lookup