6.2.4. 访问供应商专有的类
本节涵盖使用 JDBC 专有类所需的步骤。当应用程序需要使用非 JDBC API 一部分的供应商专有功能时这是有必要的。
警告
重要
重要
过程 6.4. 在应用程序里添加依赖关系
配置
MANIFEST.MF文件- 在文本编辑器里打开应用程序的
META-INF/MANIFEST.MF文件。 - 为 JDBC 模块添加一个依赖关系并保存文件。
依赖关系:MODULE_NAME
例 6.5. 依赖关系示例
依赖关系:com.mysql
创建一个
jboss-deployment-structure.xml文件在应用程序的META-INF/orWEB-INF文件夹里创建一个名为jboss-deployment-structure.xml的文件。例 6.6.
jboss-deployment-structure.xml文件示例<jboss-deployment-structure> <deployment> <dependencies> <module name="com.mysql" /> </dependencies> </deployment> </jboss-deployment-structure>
例 6.7. 访问供应商专有的 API
import java.sql.Connection; import org.jboss.jca.adapters.jdbc.WrappedConnection; Connection c = ds.getConnection(); WrappedConnection wc = (WrappedConnection)c; com.mysql.jdbc.Connection mc = wc.getUnderlyingConnection();

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.