diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml index 5b4f8499ac..73508b29da 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.12.xml @@ -3314,6 +3314,48 @@ configuration.set( +
+ Custom Unwrappers + +

+ JDBC knows the API, which is implemented by all JDBC types in order to be able to "unwrap" a native driver implementation for any given type. For example: +

+ + + +

+ jOOQ internally makes similar calls occasionally. For this, it needs to unwrap the native or instance. Unfortunately, not all third party libraries correctly implement the Wrapper API contract, so this unwrapping might not work. The SPI is designed to allow for custom implementations to be injected into jOOQ configurations: +

+ + T unwrap(Wrapper wrapper, Class iface) { + try { + if (wrapper instanceof Connection) + // ... + else if (wrapper instanceof Statement) + // ... + else + wrapper.unwrap(iface); + } + catch (SQLException e) { + // ... + } + } +}); + +// Work with the derived configuration, where needed +DSL.using(c2).fetch("...");]]> +
+
+
Custom Settings