org.jdbi.v3.core.Handle.close()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.jdbi.v3.core.Handle.close()方法的一些代码示例,展示了Handle.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handle.close()方法的具体详情如下:
包路径:org.jdbi.v3.core.Handle
类名称:Handle
方法名:close

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();
    }
  }
}

相关文章