Codota Logo
DBI.close
Code IndexAdd Codota to your IDE (free)

How to use
close
method
in
org.skife.jdbi.v2.DBI

Best Java code snippets using org.skife.jdbi.v2.DBI.close (Showing top 2 results out of 315)

  • Common ways to obtain DBI
private void myMethod () {
DBI d =
  • Codota IconDataSource dataSource;new DBI(dataSource)
  • Codota IconConnectionFactory connectionFactory;new DBI(connectionFactory)
  • Codota IconString url;String username;String password;new DBI(url, username, password)
  • Smart code suggestions by Codota
}
origin: org.jdbi/jdbi

@Test
public void testOpenNewSpiffy() throws Exception
{
  Spiffy spiffy = dbi.open(Spiffy.class);
  try {
    spiffy.insert(new Something(1, "Tim"));
    spiffy.insert(new Something(2, "Diego"));
    assertEquals("Diego", spiffy.findNameById(2));
  }
  finally {
    dbi.close(spiffy);
  }
  assertTrue(spiffy.getHandle().getConnection().isClosed());
}
origin: org.kill-bill.commons/killbill-jdbi

@Test
public void testOpenNewSpiffy() throws Exception
{
  Spiffy spiffy = dbi.open(Spiffy.class);
  try {
    spiffy.insert(new Something(1, "Tim"));
    spiffy.insert(new Something(2, "Diego"));
    assertEquals("Diego", spiffy.findNameById(2));
  }
  finally {
    dbi.close(spiffy);
  }
  assertTrue(spiffy.getHandle().getConnection().isClosed());
}
org.skife.jdbi.v2DBIclose

Javadoc

Used to close a sql object which lacks a close() method.

Popular methods of DBI

  • <init>
    Constructor used to allow for obtaining a Connection in a customized manner. The org.skife.jdbi.v2.t
  • open
  • onDemand
    Create a new sql object which will obtain and release connections from this dbi instance, as it need
  • registerMapper
    Register a result set mapper which will have its parameterized type inspected to determine what it m
  • withHandle
    A convenience function which manages the lifecycle of a handle and yields it to a callback for use b
  • registerArgumentFactory
  • inTransaction
  • setSQLLog
    Specify the class used to log sql statements. Will be passed to all handles created from this instan
  • registerContainerFactory
  • setStatementLocator
    Use a non-standard StatementLocator to look up named statements for all handles created from this DB
  • setStatementRewriter
    Use a non-standard StatementRewriter to transform SQL for all Handle instances created by this DBI.
  • setTransactionHandler
    Specify the TransactionHandler instance to use. This allows overriding transaction semantics, or map
  • setStatementRewriter,
  • setTransactionHandler,
  • setTimingCollector,
  • useHandle,
  • define,
  • getStatementLocator,
  • getTransactionHandler,
  • registerColumnMapper

Popular in Java

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now