Class OpenTelemetryDriver
java.lang.Object
io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver
- All Implemented Interfaces:
Driver
JDBC driver for OpenTelemetry.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) connect(String url, Properties info) static voidAccording to JDBC specification, this driver is registered againstDriverManagerwhen the class is loaded.intintgetPropertyInfo(String url, Properties info) static booleanReturnstrueif the driver is registered againstDriverManager.booleanReturns false because not all delegated drivers are JDBC compliant.static voidregister()Register the driver againstDriverManager.
-
Constructor Details
-
OpenTelemetryDriver
public OpenTelemetryDriver()
-
-
Method Details
-
register
Register the driver againstDriverManager. This is done automatically when the class is loaded. Dropping the driver from DriverManager's list is possible usingderegister()method.- Throws:
IllegalStateException- if the driver is already registeredSQLException- if registering the driver fails
-
deregister
According to JDBC specification, this driver is registered againstDriverManagerwhen the class is loaded. To avoid leaks, this method allow unregistering the driver so that the class can be gc'ed if necessary.- Throws:
IllegalStateException- if the driver is not registeredSQLException- if deregistering the driver fails
-
isRegistered
public static boolean isRegistered()Returnstrueif the driver is registered againstDriverManager. -
connect
- Specified by:
connectin interfaceDriver- Throws:
SQLException
-
acceptsURL
- Specified by:
acceptsURLin interfaceDriver
-
getPropertyInfo
- Specified by:
getPropertyInfoin interfaceDriver- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion()- Specified by:
getMajorVersionin interfaceDriver
-
getMinorVersion
public int getMinorVersion()- Specified by:
getMinorVersionin interfaceDriver
-
jdbcCompliant
public boolean jdbcCompliant()Returns false because not all delegated drivers are JDBC compliant.- Specified by:
jdbcCompliantin interfaceDriver
-
getParentLogger
- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-