开发者

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/.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜