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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content