org.skife.jdbi.v2.spring
Class DBIUtil
java.lang.Object
org.skife.jdbi.v2.spring.DBIUtil
public class DBIUtil
- extends Object
Utility for working with jDBI and Spring transaction bound resources
Method Summary |
static void |
closeIfNeeded(Handle h)
Close a handle if it is not transactionally bound, otherwise no-op |
static Handle |
getHandle(IDBI dbi)
Obtain a Handle instance, either the transactionally bound one if we are in a transaction,
or a new one otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DBIUtil
public DBIUtil()
closeIfNeeded
public static void closeIfNeeded(Handle h)
- Close a handle if it is not transactionally bound, otherwise no-op
- Parameters:
h
- the handle to consider closing
getHandle
public static Handle getHandle(IDBI dbi)
- Obtain a Handle instance, either the transactionally bound one if we are in a transaction,
or a new one otherwise.
- Parameters:
dbi
- the IDBI instance from which to obtain the handle
Copyright © 2013. All Rights Reserved.