use Extension
fun <E : Any, X : Exception> Jdbi.useExtension(extensionType: KClass<E>, callback: ExtensionConsumer<E, X>)
Content copied to clipboard
A convenience method which opens an extension of the given type, and yields it to a callback. A handle is opened if needed by the extention, and closed before returning to the caller.
Parameters
extension Type
the type of extension
callback
a callback which will receive the extension
Throws
org. jdbi. v3. core. extension. No Such Extension Exception
if no org.jdbi.v3.core.extension.ExtensionFactory is registered which supports the given extension type.
if thrown by the callback.