i have a java interface and its implementation which talks to an oracle db. in the implementation i lookup the db using jndi name for the connection pool which is specified in the app server (glassfish v3). when i include this java app as a jar file in my classpath and call methods on it to talk to the db it works fine for me.
But when my team mate is trying to use this java same app as a jar file in his classpath and tries to talk to the db he gets errors while looking up the jndi name of the connection pool.
we have tried changing the name of the connection pool etc but no luck. any suggestions would be much apprecitated.
here how the java app looks up the db
we both use java 1.5, oracle 11g db.
thanks in advance.
forgot to mention we both deployed our code against the same app server which talks to the same db.
Why don't you use EJB?..
As far as i know, Glassfish V3 has supported to EJB3.1 (the newer version of EJB, and its lighter than EJB3.0)..
if you work in EJB, you could inject the DataSource as follow :
Hope that helps..
please correct me if i'm wrong..
Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Jaikiran Pai wrote:
There are certainly new things in EJB3.1, but I wouldn't call EJB3.1 lighter than 3.0 Are you talking about the no-interface view of EJB3.1?
Hi Jaikiran Pai ..
i meant it because as far as i know, we could put EJB3.1 directly in WebApplication..
so, i think EJB3.1 lighter..
as far as i know, interface is become optional in EJB3.1.. //sorry, if i'm mistaken..