gpt4 book ai didi

jdbc - 在 WildFly 中将 JDBC 驱动程序作为模块安装有什么好处

转载 作者:行者123 更新时间:2023-12-04 21:14:02 26 4
gpt4 key购买 nike

这个link解释了关于 WildFly 的新事物。下Migrating The Database Connection -> JDBC Driver本文解释了两种为应用程序使用 jdbc 驱动程序的方法。我尝试将它安装为一个模块,它工作正常。问题是哪种方式更好,何时更好,whether deploy it as any other application package or install it as a module?(我注意到集群环境需要将其安装为模块。我正在寻找,还有其他原因吗?)

最佳答案

我认为您引用的文章的正确链接是:http://wildfly.org/news/2014/02/06/GlassFish-to-WildFly-migration/
(另外一篇好像没有指向你说的那篇文章)

以下是您引用的“迁移数据库连接”部分中有趣的部分:

On WildFly, you have two ways of installing the JDBC driver: whether you deploy it as any other application package or you install it as a module. You can always choose to deploy the driver, but it’s specially recommend when you have a cluster environment, since the deployments are automatically propagated in the server groups. You may have issues with the deployment if the driver is not JDBC4-compliant. In this case, installing the driver as a module solves those issues. The advantage of the JDBC driver as a module is the possibility of creating a custom WildFly bundle for your organization. This way, you can repeat exactly the same installation throughout several machines, preserving the same configuration. This is perfect for the development environment.



所以在本节中,作者描述了以下优点:

You may have issues with the deployment if the driver is not JDBC4-compliant. In this case, installing the driver as a module solves those issues.



以下野蝇 documentation也描述了这一点:

Any JDBC 4-compliant driver will automatically be recognized and installed into the system by name and version. A JDBC JAR is identified using the Java service provider mechanism. Such JARs will contain a text a file named META-INF/services/java.sql.Driver, which contains the name of the class(es) of the Drivers which exist in that JAR. If your JDBC driver JAR is not JDBC 4-compliant, it can be made deployable in one of a few ways. (...)



因此,将驱动程序部署为模块比将其部署为任何其他应用程序包更容易,以防它不兼容 JDBC-4。 (因为您必须修改和重建不符合 JDBC-4 的 jar 才能将其部署为任何其他应用程序包)

关于jdbc - 在 WildFly 中将 JDBC 驱动程序作为模块安装有什么好处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28693660/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com