Tabnine Logo
DataSourceConnectionProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
DataSourceConnectionProvider
in
org.jooq.impl

Best Java code snippets using org.jooq.impl.DataSourceConnectionProvider (Showing top 11 results out of 315)

origin: spring-projects/spring-data-examples

@Bean
public DataSourceConnectionProvider connectionProvider() {
  return new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy(dataSource));
}
origin: jooby-project/jooby

 @Override
 public void configure(final Env env, final Config conf, final Binder binder) {
  Key<DataSource> dskey = Key.get(DataSource.class, Names.named(name));
  Supplier<NoSuchElementException> noSuchElement = () -> new NoSuchElementException(
    "DataSource missing: " + dskey);
  HikariDataSource ds = (HikariDataSource) env.get(dskey).orElseThrow(noSuchElement);
  Configuration jooqconf = new DefaultConfiguration();
  ConnectionProvider dscp = new DataSourceConnectionProvider(ds);
  jooqconf.set(JDBCUtils.dialect(env.get(Key.get(String.class, Names.named(name + ".url")))
    .orElseThrow(noSuchElement)));
  jooqconf.set(dscp);
  jooqconf.set(new DefaultTransactionProvider(dscp));

  if (callback != null) {
   callback.accept(jooqconf, conf);
  }

  ServiceKey serviceKey = env.serviceKey();
  serviceKey.generate(Configuration.class, name, k -> binder.bind(k).toInstance(jooqconf));

  Provider<DSLContext> dsl = () -> DSL.using(jooqconf);
  serviceKey.generate(DSLContext.class, name, k -> binder.bind(k).toProvider(dsl));
 }
}
origin: org.jooq/jooq

public DefaultDSLContext(DataSource datasource, SQLDialect dialect, Settings settings) {
  this(new DefaultConfiguration(new DataSourceConnectionProvider(datasource), null, null, null, null, null, null, null, null, null, null, null,  null,  dialect, settings, null));
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

public DefaultDSLContext(DataSource datasource, SQLDialect dialect, Settings settings) {
  this(new DefaultConfiguration(new DataSourceConnectionProvider(datasource), null, null, null, null, dialect, settings, null));
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Convenience method for {@link #set(ConnectionProvider)}, using a
 * {@link DataSourceConnectionProvider}.
 */
public final Configuration set(DataSource newDataSource) {
  return set(new DataSourceConnectionProvider(newDataSource));
}
origin: org.jooq/jooq

@Override
public final Configuration set(DataSource newDataSource) {
  return set(new DataSourceConnectionProvider(newDataSource));
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Convenience method for {@link #derive(ConnectionProvider)}, using a
 * {@link DataSourceConnectionProvider}.
 */
public final Configuration derive(DataSource newDataSource) {
  return derive(new DataSourceConnectionProvider(newDataSource));
}
origin: org.jooq/jooq

@Override
public final Configuration derive(DataSource newDataSource) {
  return derive(new DataSourceConnectionProvider(newDataSource));
}
origin: rancher/cattle

@Bean
DataSourceConnectionProvider JooqConnectionProvider(@Qualifier("DataSource") DataSource ds) {
  return new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy(ds));
}
origin: k55k32/cms-admin-end

@Bean
public DataSourceConnectionProvider dataSourceConnectionProvider(){
  return new DataSourceConnectionProvider(new TransactionAwareDataSourceProxy(dataSource()));
}
origin: StubbornJava/StubbornJava

public static Configuration defaultConfigFromDataSource(DataSource ds) {
  DataSourceConnectionProvider dcp = new DataSourceConnectionProvider(ds);
  Configuration jooqConfig = new DefaultConfiguration();
  jooqConfig.set(SQLDialect.MYSQL);
  jooqConfig.set(dcp);
  //jooqConfig.set(new ThreadLocalTransactionProvider(dcp));
  jooqConfig.settings()
       .withExecuteWithOptimisticLockingExcludeUnversioned(true);
  return jooqConfig;
}
org.jooq.implDataSourceConnectionProvider

Javadoc

A default implementation for a pooled DataSource-oriented ConnectionProvider

This implementation wraps a JDBC DataSource. jOOQ will use that data source for initialising connections, and creating statements.

Use this connection provider if you want to run distributed transactions, such as javax.transaction.UserTransaction. jOOQ will Connection#close() all connections after query execution (and result fetching) in order to return the connection to the connection pool. If you do not use distributed transactions, this will produce driver-specific behaviour at the end of query execution at close() invocation (e.g. a transaction rollback). Use a DefaultConnectionProviderinstead, to control the connection's lifecycle, or implement your own ConnectionProvider.

Most used methods

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • String (java.lang)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 14 Best Plugins for Eclipse
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