JDBC 数据源的 JNDI 路径?

发布于 2024-10-05 12:58:18 字数 256 浏览 0 评论 0原文

我有时会看到 JNDI 中指定的 JDBC 数据源使用“jdbc”路径。例如,以下内容(对于 Tomcat6):

<Resource name="jdbc/myAppDS" auth="Container" type="javax.sql.DataSource"
       ..... />

但其他时候我看到它的 JNDI 路径名中没有“jdbc”。使用“jdbc”只是一种约定吗?是典型的吗?这些东西记录在哪里?

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="Container" 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城旧梦 2024-10-12 12:58:18

这只是惯例。您可以随意称呼该资源,但如果您在上下文中定义了许多资源,则使用标准前缀可以更轻松地识别它实际上是什么类型的资源。

以类似的方式,JavaBean 资源通常以 bean/ 开头,而 Mail 资源将以 mail/ 开头。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文