Jason,
This is how it works.
Localnamespace - java:comp/env is a local name space used by the application. The name that you use in it jdbc/db is just an alias. It does not refer to a physical resource.
During deployment this alias should be mapped to a physical resource (in your case a data source) that is defined on the WAS/WPS run time.
This is actually stored in ejb-bnd.xmi files. In the latest versions the XMIs are replaced with XML files. These files are referred to as the Binding files.
HTH Manglu