How can I replace JDBC driver class when using JDBC4 Driver on JBoss?

Solution Verified - Updated -

Issue

In JDBC 4 spec defined DriverManager which reads content of META-INF/services/java.sql.Driver inside of JDBC driver, and loads it as driver class. So whatever you write in <driver-class> of DS file, the value will be ignored. For some proposes, I'd like to use specified JDBC class. Such as like using p6spy, I prefer to use com.p6spy.engine.spy.P6SpyDriver as JDBC class, instead of the real one in JDBC driver.
Now to settle of the issue, I have to delete services/java.sql.Driver from driver. It works well, but I reckon it's some awkward. Is there anyway in EAP to specify JDBC class?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x

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.