Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16492

[DOC][EAP 7.2] Access Vendor-Specific Classes

XMLWordPrintable

      Access Vendor-Specific Classes section is using a org.jboss.jca.adapters.jdbc.WrappedConnection class to access vendor specific jdbc Connection.

      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();
      

      It is necessary to add dependencies of org.jboss.ironjacamar.jdbcadapters module to jboss-deployment-structure.xml, but the jdbcadapters module is a private module. We do not recommend to use private module in customer's application, It is better to use JDBC 4 Wrapper class instead of jdbcadapters module class like a below.

      import java.sql.Connection;
      ...
      Connection c = ds.getConnection();
      if (c.isWrapperFor(com.mysql.jdbc.Connection.class)) {
          com.mysql.jdbc.Connection mc = c.unwrap(com.mysql.jdbc.Connection.class);
      }
      

            snelluli@redhat.com Sreelatha Nelluli
            rhn-support-enagai Eiichi Nagai (Inactive)
            Jan Blizňák Jan Blizňák
            Jan Blizňák Jan Blizňák
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: