guys, I am reading that when a datasource to be looked up in a EJB project each ejb should have reference-ref defined. My question is if this EJB project has a java file (say.. a utility class) which needs to lookup datasource, where should be the reference-ref defined. Or what is the standard way of looking up datasource in this case whcih is compatible with J2EE (so I can use the same technique whcih works with all app servers)
resource-ref are not mandatory but are recommended. If the java utility is being used as part of a servlet then the resource-ref will go into the web.xml. If that utility is part of an EJB then it will go in ejb-jar.xml. There's thisthread which talks more on such things, which you might be interested in.