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

How to use
DatasourceConnectionProviderImpl
in
org.hibernate.engine.jdbc.connections.internal

Best Java code snippets using org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl (Showing top 17 results out of 315)

origin: dropwizard/dropwizard

private ConnectionProvider buildConnectionProvider(DataSource dataSource,
                          Map<String, String> properties) {
  final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(dataSource);
  connectionProvider.configure(properties);
  return connectionProvider;
}
origin: hibernate/hibernate-orm

@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
  if ( ConnectionProvider.class.equals( unwrapType ) ||
      DatasourceConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
    return (T) this;
  }
  else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
    return (T) getDataSource();
  }
  else {
    throw new UnknownUnwrapTypeException( unwrapType );
  }
}
origin: vladmihalcea/high-performance-java-persistence

  @Override
  public void configure(Map configValues) {
    super.configure(configValues);
    DataSource dataSource = ProxyDataSourceBuilder
        .create(getDataSource())
        .name(getClass().getSimpleName())
        .listener(new SLF4JQueryLoggingListener())
        .build();
    super.setDataSource(dataSource);
  }
}
origin: stackoverflow.com

connectionProvider = new DatasourceConnectionProviderImpl();
origin: hibernate/hibernate-orm

connectionProvider.configure(
    Collections.singletonMap(
        Environment.DATASOURCE,
origin: io.jdev.miniprofiler/miniprofiler-core

@Override
public Connection getConnection() throws SQLException {
  return new ConnectionSpy(super.getConnection());
}
origin: hibernate/hibernate-orm

return new DatasourceConnectionProviderImpl();
origin: vladmihalcea/high-performance-java-persistence

@Override
public void configure(Map props) {
  super.configure(props);
  flexyPoolDataSource = new FlexyPoolDataSource<>(getDataSource());
}
origin: vladmihalcea/high-performance-java-persistence

@Override
public Connection getConnection()
    throws SQLException {
  Connection connection = connectionHolder.get();
  if(connection == null) {
    connection = super.getConnection();
    if (!autoCommit.get()) {
      connection.setAutoCommit(false);
    }
    connectionHolder.set(connection);
  }
  return connection;
}
origin: io.dropwizard/dropwizard-hibernate

private ConnectionProvider buildConnectionProvider(DataSource dataSource,
                          Map<String, String> properties) {
  final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(dataSource);
  connectionProvider.configure(properties);
  return connectionProvider;
}
origin: org.hibernate.orm/hibernate-core

return new DatasourceConnectionProviderImpl();
origin: stackoverflow.com

 SessionFactoryImpl factory = (SessionFactoryImpl) session.getSessionFactory(); // or directly cast the sessionFactory
DatasourceConnectionProviderImpl provider = (DatasourceConnectionProviderImpl)factory.getConnectionProvider();
DataSource dataSource = provider.getDataSource();
origin: in.cleartax.dropwizard/sharding-core

private ConnectionProvider buildConnectionProvider(DataSource dataSource,
                          Map<String, String> properties) {
  final DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(dataSource);
  connectionProvider.configure(properties);
  return connectionProvider;
}
origin: org.hibernate.orm/hibernate-core

@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
  if ( ConnectionProvider.class.equals( unwrapType ) ||
      DatasourceConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
    return (T) this;
  }
  else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
    return (T) getDataSource();
  }
  else {
    throw new UnknownUnwrapTypeException( unwrapType );
  }
}
origin: com.thesett.jenerator.utils/jenerator_util_dropwizard_0.9

/**
 * Creates a {@link ConnectionProvider} from a data source.
 *
 * @param  dataSource The data source to create a connection provider from.
 * @param  properties Additional configuration properties.
 *
 * @return A connection provider for the data source.
 */
private ConnectionProvider buildConnectionProvider(DataSource dataSource, Map<String, String> properties) {
  DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(dataSource);
  connectionProvider.configure(properties);
  return connectionProvider;
}
origin: vladmihalcea/high-performance-java-persistence

private void addTenantConnectionProvider(String tenantId, DataSource tenantDataSource, Properties properties) {
  DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(tenantDataSource);
  connectionProvider.configure(properties);
  MultiTenantConnectionProvider.INSTANCE.getConnectionProviderMap().put(
      tenantId, connectionProvider
  );
}
origin: vladmihalcea/high-performance-java-persistence

private void addTenantConnectionProvider(String tenantId, DataSource tenantDataSource, Properties properties) {
  DatasourceConnectionProviderImpl connectionProvider = new DatasourceConnectionProviderImpl();
  connectionProvider.setDataSource(tenantDataSource);
  connectionProvider.configure(properties);
  MultiTenantConnectionProvider.INSTANCE.getConnectionProviderMap().put(
      tenantId, connectionProvider
  );
}
org.hibernate.engine.jdbc.connections.internalDatasourceConnectionProviderImpl

Javadoc

A org.hibernate.engine.jdbc.connections.spi.ConnectionProvider that manages connections from an underlying DataSource.

The DataSource to use may be specified by either:

  • injection via #setDataSource
  • decaring the DataSource instance using the Environment#DATASOURCE config property
  • decaring the JNDI name under which the DataSource can be found via Environment#DATASOURCE config property

Most used methods

  • <init>
  • configure
  • setDataSource
  • getDataSource
  • getConnection
  • closeConnection
  • isUnwrappableAs
  • stop

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Notification (javax.management)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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