How to register a data source in JNDI is dependent on the application server that your are using, most application servers have admin interface that user can use to create a data source.
After creating your data source you will have to add in your deployment descriptor (e.g. web.xml or ejb.xml) a resoruce-ref element
It means that your application is dependent on a datasource whose name jdbc/Test
The last step is to lookup your datasource from inside your code
There are only two names resource-ref name and the real datasource name. The JNDI name you use to lookup (resource-ref name) doesn't have to be the same as the one you created in your application server. Most application servers have vendor specific deployment descriptor that you can you use to map your resource-ref name to the real datasource name.
And the answer to your second question is yes.
I hope this clear up this matter.