JMX MBean provided with Oracle JDBC Driver

I discovered that Oracle added a JMX MBean in Oracle JDBC Driver.
It’s called « Diagnosability Management ».

Doc for version 11g :
https://docs.oracle.com/cd/B28359_01/java.111/b31224/diagnose.htm#CIAIEEFF

Resume :

The JDBC diagnosability management feature introduces an MBean, oracle.jdbc.driver.OracleDiagnosabilityMBean. This MBean provides means to enable and disable JDBC logging.

Description of the MBean :

  • Name :
    • Domain : com.oracle.jdbc
    • Name : org.jboss.classloader.spi.base.BaseClassLoader
    • Type : diagnosability
  • Attribute Name : LoggingEnabled (boolean)
Publicités

Logging with Oracle JDBC Driver

Doc for version 11g :
https://docs.oracle.com/cd/B28359_01/java.111/b31224/diagnose.htm#CIAGBGFI

Logging is done using java.util.logging package provided by Java SE.

To get log output, you must use the debug JAR files, which are indicated with a « _g » in the file name, like ojdbc5_g.jar or ojdbc6_g.jar. The debug JAR file must be included in the CLASSPATH environment variable.

Resume :

This feature logs information about events that occur when JDBC driver code runs. Events can include user-visible events, such as SQL exceptions, running of SQL statements, and detailed JDBC internal events, such as entry to and exit from internal JDBC methods. Users can enable this feature to log specific events or all the events.