I have a need to get a DataSource object to be passed to a method. I am testing it locally using a class with main method and so can not usde JNDI context to look up from server's environment. The actual code is like this
which works fine when the server is running as it gets it from environment.
But when I want to run the code locally with a test class I can't get the dataSource.I see that DataSource class doesn't have setters for URL, login, password etc. Is there a way to get DataSource object locally?