JFR JDBC

A JDBC wrapper that generates JFR events.

License

License

MIT
GroupId

GroupId

com.github.marschall
ArtifactId

ArtifactId

jfr-jdbc
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

JFR JDBC
A JDBC wrapper that generates JFR events.
Project URL

Project URL

https://github.com/marschall/jfr-jdbc
Source Code Management

Source Code Management

https://github.com/marschall/jfr-jdbc

Download jfr-jdbc

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.marschall/jfr-jdbc/ -->
<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>jfr-jdbc</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.marschall/jfr-jdbc/
implementation 'com.github.marschall:jfr-jdbc:0.4.0'
// https://jarcasting.com/artifacts/com.github.marschall/jfr-jdbc/
implementation ("com.github.marschall:jfr-jdbc:0.4.0")
'com.github.marschall:jfr-jdbc:jar:0.4.0'
<dependency org="com.github.marschall" name="jfr-jdbc" rev="0.4.0">
  <artifact name="jfr-jdbc" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.marschall', module='jfr-jdbc', version='0.4.0')
)
libraryDependencies += "com.github.marschall" % "jfr-jdbc" % "0.4.0"
[com.github.marschall/jfr-jdbc "0.4.0"]

Dependencies

test (7)

Group / Artifact Type Version
com.h2database : h2 jar 1.4.199
org.junit.jupiter : junit-jupiter jar 5.5.0
org.hamcrest : hamcrest-junit jar 2.0.0.0
org.springframework : spring-jdbc jar 5.1.8.RELEASE
org.apache.logging.log4j : log4j-core jar 2.12.0
org.apache.logging.log4j : log4j-slf4j-impl jar 2.12.0
org.apache.logging.log4j : log4j-jcl jar 2.12.0

Project Modules

There are no modules declared in this project.

JFR JDBC Maven Central Javadocs Build Status

A JDBC driver that wraps an other JDBC driver and generates JFR events.

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>jfr-jdbc</artifactId>
  <version>0.4.0</version>
</dependency>

Usage

Simply wrap your DataSource with a JfrDataSource

new JfrDataSource(dataSource)

If you use Driver simply prefix your JDBC URL with "jfr:" for example use "jdbc:jfr:h2:mem:" instead of "jdbc:h2:mem:".

The project is a Java module with the name com.github.marschall.jfr.jdbc.

Implementation/Overhead

The implementation is based around wrapper objects.

  • no reflection
  • no string concatenation

Caveats

  • does not work with Oracle explicit statement caching
  • does not work with unwrapped objects
  • does not work with implicitly closed objects
  • does not work with cached statements provided by a connection pool
  • only accessing the first warning is instrumented, accessing the following ones is not
  • reconstructing the JDBC call time and row count is not super reliable especially in the case for more exotic row iteration

Versions

Version
0.4.0
0.3.0
0.2.0
0.1.0