See this recipe's full source code at: https://github.com/eldermoraes/javaee8-cookbook/tree/master/chapter06/ch06-connectionpooling