本文整理了Java中org.jdbi.v3.core.Handle.close()
方法的一些代码示例,展示了Handle.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handle.close()
方法的具体详情如下:
包路径:org.jdbi.v3.core.Handle
类名称:Handle
方法名:close
[英]Closes the handle, its connection, and any other database resources it is holding.
[中]关闭句柄、其连接以及它所持有的任何其他数据库资源。
代码示例来源:origin: prestodb/presto
@Override
public void close()
{
handle.close();
}
代码示例来源:origin: jdbi/jdbi
/**
* Close a handle if it is not transactionally bound, otherwise no-op
* @param handle the handle to consider closing
*/
public static void closeIfNeeded(Handle handle) {
if (!TRANSACTIONAL_HANDLES.contains(handle)) {
handle.close();
}
}
代码示例来源:origin: prestodb/presto
@AfterClass(alwaysRun = true)
public void close()
{
handle.close();
}
代码示例来源:origin: prestodb/presto
@AfterClass(alwaysRun = true)
public void close()
{
handle.close();
}
代码示例来源:origin: jdbi/jdbi
private This cleanupHandle(Consumer<Handle> action) {
addCleanable(() -> {
if (handle != null) {
if (handle.isInTransaction()) {
action.accept(handle);
}
handle.close();
}
});
return typedThis;
}
代码示例来源:origin: jdbi/jdbi
@After
public void doTearDown() {
if (h != null) {
h.close();
}
}
代码示例来源:origin: jdbi/jdbi
@After
public void after() {
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void doTearDown() {
if (h != null) {
h.close();
}
}
代码示例来源:origin: jdbi/jdbi
@After
public void doTearDown() {
if (h != null) {
h.close();
}
}
代码示例来源:origin: jdbi/jdbi
@After
public void doTearDown() {
if (h != null) {
h.close();
}
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.execute("drop table foo");
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void exit() {
handle.execute("drop table something");
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.execute("drop table something");
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.execute("drop table something");
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.execute("drop table something");
handle.close();
}
代码示例来源:origin: jdbi/jdbi
@After
public void tearDown() {
handle.execute("drop table something");
handle.close();
}
}
代码示例来源:origin: jdbi/jdbi
@SuppressWarnings("resource")
@Test
public void testIsClosed() {
Handle h = dbRule.openHandle();
assertThat(h.isClosed()).isFalse();
h.close();
assertThat(h.isClosed()).isTrue();
}
代码示例来源:origin: jdbi/jdbi
@Test
public void testCloseWithOpenContainerManagedTransaction() throws Exception {
try (Connection conn = dbRule.getConnectionFactory().openConnection()) {
conn.setAutoCommit(false); // open transaction
Handle handle = Jdbi.open(conn);
handle.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!