I am using the default DataSource provided along with the glassfish server (Derby). When I try to connect to it using servlets it works without any problem. But what am trying to do is use a common POJO from which I can get a Connection. So when I try to use the DataSource in a POJO it doesn't work.
I know that Servlets can refer to DataSource through resource ref and glassfish-resources.xml
Am using netbeans. Is there a way so that I can use a POJO for using DataSource. This question has come up time and again. But I couldn't find any solution. Its not that I want to use server DataSource, I want it to be declarative rather than programmatic.
I know this question has come up before but that thread is dead.