code: private DataSource lookupDS(InitialContext ctx, String path) {
          try {
              return (DataSource) ctx.lookup(path);
          } catch (NamingException e) {
              return null;
          }
      }
docs: Lookup the datasource from JNDI.
  @param ctx
  @param path