JNDI Path for JDBC data sources?
I sometimes see JDBC data sources specified in JNDI that use the "jdbc" path. For example, the following (for Tomcat6):
<Resource name="jdbc/myAppDS" auth="Contain开发者_开发问答er" type="javax.sql.DataSource"
..... />
But then other times I see it without the "jdbc" in the JNDI path name. Is using the "jdbc" just a convention? Is it typical? Where are these things documented?
It's just convention. You can call the resource whatever you like, but if you have many resources defined in your context, using a standard prefix makes it easier to identify what kind of resource it actually is.
In a similar fashion, a JavaBean resource would conventionally begin with bean/
and a Mail resource would begin with mail/
.
精彩评论