Fire up the glassfish admin console at http://localhost:4848. You will see something like:
Select the JDBC Connection Pools item and then new:
Enter the values below:
Press next and face a table with 213 additional properties, all together. Morons. Anyway:
and:
and:
and:
and:
Done!
Now for the resource:
and:
Hit OK.
See also:
Java EE 7 GlassFish 4.0 Restful Webservices using and Netbean and deploying on Glassfish 4.0