The service you mentioned binds a
javax.sql.DataSource into jndi which you should lookup.
ds = (DataSource) new InitialContext ().lookup("java:yournamehere");
Don't forget to close everything when you are done.
This test source might help?
Thanks for your suggestion.
I have fixed the problem.