How to get the vendor specific jdbc Connection/Statement object in JBoss EAP 6/7

Solution Verified - Updated -

Issue

  • Need to access Oracle specific oracle.jdbc.driver.OracleConnection and oracle.jdbc.OracleCallableStatement
  • Encountered a ClassCastException when attempting to cast to the vendor specific connection object (e.g. oracle.jdbc.driver.OracleConnection):

    java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.driver.OracleConnection
    
  • Encountered a ClassCastNotFoundException when migrating code running successfully in EAP 5 to EAP 6/7

    java.lang.ClassNotFoundException: org.jboss.resource.adapter.jdbc.WrappedConnection 
    
  • Warnings are reported in the server.log when declaring an explicit dependency on the org.jboss.ironjacamar.jdbcadapters module

    ... WARN  [org.jboss.as.dependency.private] ... JBAS015867: Deployment "deployment.myapp.war" is using a private module ("org.jboss.ironjacamar.jdbcadapters:main") which may be changed or removed in future versions without notice.
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6
    • 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.