Java Reference
In-Depth Information
Once we have our
web.xml
, we are ready to add our datasource reference. When
creating our
web.xml
, NetBeans automatically opens it using the built-in
web.xml
editor.
We can add the resource reference by clicking on the
Add...
button under
Resource
References
.
For our purposes, all we need to do is add a value for the
Resource
Name
text field,
the value of this field must be the
JNDI
(
Java Naming and Directory Interface
)
name of the data source we wish to use with our application, in our specific example,
this JNDI name is
jdbc/sample
.