with Extension
fun <E : Any, R, X : Exception> Jdbi.withExtension(extensionType: KClass<E>, callback: ExtensionCallback<R, E, X>): R
Content copied to clipboard
A convenience method which opens an extension of the given type, yields it to a callback, and returns the result of the callback. A handle is opened if needed by the extension, and closed before returning to the caller.
Return
the value returned by the callback.
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.