congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DBI.setStatementRewriter
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/incubator-druid

@Inject
public SQLServerConnector(Supplier<MetadataStorageConnectorConfig> config, Supplier<MetadataStorageTablesConfig> dbTables)
{
 super(config, dbTables);
 final BasicDataSource datasource = getDatasource();
 datasource.setDriverClassLoader(getClass().getClassLoader());
 datasource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
 this.dbi = new DBI(datasource);
 this.dbi.setStatementRewriter(new CustomStatementRewriter());
 log.info("Configured Sql Server as metadata storage");
}
origin: jooby-project/jooby

@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void configure(final Env env, final Config config, final Binder binder) {
 Key<DataSource> dskey = Key.get(DataSource.class, Names.named(name));
 DataSource ds = env.get(dskey)
   .orElseThrow(() -> new NoSuchElementException("DataSource missing: " + dskey));
 DBI dbi = new DBI2(ds);
 dbi.setSQLLog(new SLF4JLog());
 dbi.registerArgumentFactory(new OptionalArgumentFactory());
 dbi.registerArgumentFactory(new IterableArgumentFactory());
 dbi.registerContainerFactory(new OptionalContainerFactory());
 dbi.setStatementRewriter(new ExpandedStmtRewriter());
 ServiceKey serviceKey = env.serviceKey();
 serviceKey.generate(DBI.class, name, k -> binder.bind(k).toInstance(dbi));
 serviceKey.generate(Handle.class, name, k -> binder.bind(k).toProvider(() -> dbi.open()));
 sqlObjects.forEach(sqlObject -> binder.bind(sqlObject)
   .toProvider((Provider) () -> dbi.open(sqlObject)));
 if (callback != null) {
  callback.accept(dbi, config);
 }
}
origin: dropwizard/dropwizard

dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter()));
origin: org.jooby/jooby-jdbi

@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void configure(final Env env, final Config config, final Binder binder) {
 Key<DataSource> dskey = Key.get(DataSource.class, Names.named(name));
 DataSource ds = env.get(dskey)
   .orElseThrow(() -> new NoSuchElementException("DataSource missing: " + dskey));
 DBI dbi = new DBI2(ds);
 dbi.setSQLLog(new SLF4JLog());
 dbi.registerArgumentFactory(new OptionalArgumentFactory());
 dbi.registerArgumentFactory(new IterableArgumentFactory());
 dbi.registerContainerFactory(new OptionalContainerFactory());
 dbi.setStatementRewriter(new ExpandedStmtRewriter());
 ServiceKey serviceKey = env.serviceKey();
 serviceKey.generate(DBI.class, name, k -> binder.bind(k).toInstance(dbi));
 serviceKey.generate(Handle.class, name, k -> binder.bind(k).toProvider(() -> dbi.open()));
 sqlObjects.forEach(sqlObject -> binder.bind(sqlObject)
   .toProvider((Provider) () -> dbi.open(sqlObject)));
 if (callback != null) {
  callback.accept(dbi, config);
 }
}
origin: org.kill-bill.commons/killbill-jdbi

@Override
public void doSetUp() throws Exception
{
  this.dbi = new DBI(DERBY_HELPER.getDataSource());
  dbi.setStatementRewriter(new NoOpStatementRewriter());
}
origin: org.jdbi/jdbi

@Override
public void doSetUp() throws Exception
{
  this.dbi = new DBI(DERBY_HELPER.getDataSource());
  dbi.setStatementRewriter(new NoOpStatementRewriter());
}
origin: org.kill-bill.commons/killbill-jdbi

@Before
public void setUp() throws Exception
{
  JdbcDataSource ds = new JdbcDataSource();
  ds.setURL(String.format("jdbc:h2:mem:%s", UUID.randomUUID()));
  DBI dbi = new DBI(ds);
  // this is the default, but be explicit for sake of clarity in test
  dbi.setStatementRewriter(new ColonPrefixNamedParamStatementRewriter());
  handle = dbi.open();
  handle.execute("create table something (id int primary key, name varchar(100))");
}
origin: org.jdbi/jdbi

@Before
public void setUp() throws Exception
{
  JdbcDataSource ds = new JdbcDataSource();
  ds.setURL(String.format("jdbc:h2:mem:%s", UUID.randomUUID()));
  DBI dbi = new DBI(ds);
  // this is the default, but be explicit for sake of clarity in test
  dbi.setStatementRewriter(new ColonPrefixNamedParamStatementRewriter());
  handle = dbi.open();
  handle.execute("create table something (id int primary key, name varchar(100))");
}
origin: org.jdbi/jdbi

@Before
public void setUp() throws Exception
{
  JdbcDataSource ds = new JdbcDataSource();
  ds.setURL("jdbc:h2:mem:" + UUID.randomUUID());
  DBI dbi = new DBI(ds);
  // this is the default, but be explicit for sake of clarity in test
  dbi.setStatementRewriter(new ColonPrefixNamedParamStatementRewriter());
  handle = dbi.open();
  handle.execute("create table something (id int primary key, name varchar(100))");
}
origin: org.kill-bill.commons/killbill-jdbi

@Before
public void setUp() throws Exception
{
  JdbcDataSource ds = new JdbcDataSource();
  ds.setURL("jdbc:h2:mem:" + UUID.randomUUID());
  DBI dbi = new DBI(ds);
  dbi.registerMapper(new SomethingMapper());
  // this is the default, but be explicit for sake of clarity in test
  dbi.setStatementRewriter(new ColonPrefixNamedParamStatementRewriter());
  handle = dbi.open();
  handle.execute("create table something (id int primary key, name varchar(100))");
}
origin: io.dropwizard/dropwizard-jdbi

dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter()));
org.skife.jdbi.v2DBIsetStatementRewriter

Javadoc

Use a non-standard StatementRewriter to transform SQL for all Handle instances created by this DBI.

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
  • setTransactionHandler
    Specify the TransactionHandler instance to use. This allows overriding transaction semantics, or map
  • setTimingCollector
    Add a callback to accumulate timing information about the queries running from this data source.
  • setTransactionHandler,
  • setTimingCollector,
  • useHandle,
  • define,
  • close,
  • getStatementLocator,
  • getTransactionHandler,
  • registerColumnMapper

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Kernel (java.awt.image)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now