I was trying a standalone java client for Oracle Datasource(using JNDI). I am able to successfully connect to this database through a servlet.
I searched few forums which said that JBoss does not support this.
Errors on connection : JNDI name not bound
Cannot get connection: javax.naming.NameNotFoundException: OracleDS not bound
I have configured required jars in classpath