By default the datasource will bind to java: namespace. So use java:test as the jndi name during the lookup. And remember that the java: namespace is visible only to clients running in the same JVM as the server where the datasource is deployed.
I use java:test in lookup.i copied the file db2java.jar to jboss<HOME>/server/default/lib folder.But i got this error while try to create connection.
I used the driver name as COM.ibm.db2.jdbc.app.DB2Driver.
Please help me...
The error says you're using the wrong driver class for the url. What that means is the driver class, COM.ibm.db2.jdbc.app.DB2Driver (as you say in your message) doesn't work with the connection url you have specified in the datasource descriptor, jdbc:db2://localhost:50000/dbinventory.
It's been a long time since I worked with DB2, so unless someone can give you better help here, you'll need to look up the JDBC driver help provided by IBM and see what they say. They should include examples of how to configure the datasource properly.
In looking at the xml file you provided, I did notice two things. First, the driver class specified in the file is different from the one specified in the commented instructions in the file - one uses com while the other uses COM. Are you sure you have that correct.
Secondly, it seems the URL format is different for the different types of drivers. Again, read through the documentation and make sure you're using all the correct configuration information for the drive you wish to use.