Class OpenTelemetryDriver
- java.lang.Object
-
- io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver
-
-
Constructor Summary
Constructors Constructor Description OpenTelemetryDriver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsURL(String url)Connectionconnect(String url, Properties info)static voidderegister()According to JDBC specification, this driver is registered againstDriverManagerwhen the class is loaded.intgetMajorVersion()intgetMinorVersion()LoggergetParentLogger()DriverPropertyInfo[]getPropertyInfo(String url, Properties info)static booleanisRegistered()Returnstrueif the driver is registered againstDriverManager.booleanjdbcCompliant()Returns false because not all delegated drivers are JDBC compliant.static voidregister()Register the driver againstDriverManager.
-
-
-
Method Detail
-
register
public static void register() throws SQLExceptionRegister 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
public static void deregister() throws SQLExceptionAccording 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
@Nullable public Connection connect(String url, Properties info) throws SQLException
- Specified by:
connectin interfaceDriver- Throws:
SQLException
-
acceptsURL
public boolean acceptsURL(String url)
- Specified by:
acceptsURLin interfaceDriver
-
getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
- 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
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-
-