Tabnine Logo
DriverManagerConnectionProviderImpl.configure
Code IndexAdd Tabnine to your IDE (free)

How to use
configure
method
in
org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl

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

origin: hibernate/hibernate-orm

private static DriverManagerConnectionProviderImpl buildConnectionProvider(Properties props, final boolean allowAggressiveRelease) {
  DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl() {
    public boolean supportsAggressiveRelease() {
      return allowAggressiveRelease;
    }
  };
  connectionProvider.configure( props );
  return connectionProvider;
}
origin: hibernate/hibernate-orm

protected void registerConnectionProvider(String tenantIdentifier, TimeZone timeZone) {
  Properties properties = properties();
  properties.put(
    Environment.URL,
    tenantUrl( properties.getProperty( Environment.URL ), tenantIdentifier )
  );
  DriverManagerConnectionProviderImpl connectionProvider =
      new DriverManagerConnectionProviderImpl();
  connectionProvider.configure( properties );
  connectionProviderMap.put( tenantIdentifier, connectionProvider );
  timeZoneTenantMap.put( tenantIdentifier, timeZone );
}
//end::multitenacy-hibernate-timezone-configuration-registerConnectionProvider-example[]
origin: hibernate/hibernate-orm

@Override
public void configure(Map configurationValues) {
  Properties connectionSettings = new Properties();
  transferSetting( Environment.DRIVER, configurationValues, connectionSettings );
  transferSetting( Environment.URL, configurationValues, connectionSettings );
  transferSetting( Environment.USER, configurationValues, connectionSettings );
  transferSetting( Environment.PASS, configurationValues, connectionSettings );
  transferSetting( Environment.ISOLATION, configurationValues, connectionSettings );
  Properties passThroughSettings = ConnectionProviderInitiator.getConnectionProperties( configurationValues );
  if ( passThroughSettings != null ) {
    for ( String setting : passThroughSettings.stringPropertyNames() ) {
      transferSetting( Environment.CONNECTION_PREFIX + '.' + setting, configurationValues, connectionSettings );
    }
  }
  connectionSettings.setProperty( Environment.AUTOCOMMIT, "false" );
  delegate = new DriverManagerConnectionProviderImpl();
  delegate.configure( connectionSettings );
}
origin: hibernate/hibernate-orm

protected void registerConnectionProvider(String tenantIdentifier) {
  Properties properties = properties();
  properties.put( Environment.URL,
    tenantUrl(properties.getProperty( Environment.URL ), tenantIdentifier) );
  DriverManagerConnectionProviderImpl connectionProvider =
    new DriverManagerConnectionProviderImpl();
  connectionProvider.configure( properties );
  connectionProviderMap.put( tenantIdentifier, connectionProvider );
}
//end::multitenacy-hibernate-MultiTenantConnectionProvider-example[]
origin: hibernate/hibernate-orm

@Override
public void buildEntityManagerFactory() {
  connectionProvider = new DriverManagerConnectionProviderImpl();
  connectionProvider.configure( Environment.getProperties() );
  try(Connection connection = connectionProvider.getConnection();
    Statement statement = connection.createStatement()) {
    statement.execute( "DROP TABLE IF EXISTS roles CASCADE" );
    statement.execute( "CREATE TABLE roles ( id BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY )" );
  }
  catch (SQLException e) {
    fail(e.getMessage());
  }
  super.buildEntityManagerFactory();
}
origin: hibernate/hibernate-orm

@Before
public void setUp() throws Exception {
  connectionProvider =
      new DriverManagerConnectionProviderImpl();
  connectionProvider.configure( properties() );
  connection = connectionProvider.getConnection();
  ssr = new StandardServiceRegistryBuilder()
    .applySetting( AvailableSettings.HBM2DDL_CONNECTION, connection )
    .build();
  tool = (HibernateSchemaManagementTool) ssr.getService( SchemaManagementTool.class );
  configurationValues = ssr.getService( ConfigurationService.class ).getSettings();
  executionOptions = new ExecutionOptions() {
    @Override
    public boolean shouldManageNamespaces() {
      return true;
    }
    @Override
    public Map getConfigurationValues() {
      return configurationValues;
    }
    @Override
    public ExceptionHandler getExceptionHandler() {
      return ExceptionHandlerLoggedImpl.INSTANCE;
    }
  };
}
origin: hibernate/hibernate-orm

connectionProvider.configure( properties() );
origin: hibernate/hibernate-demos

private ConnectionProvider buildConnectionProvider(String dbName) {
  Properties props = new Properties( null );
  props.put( "hibernate.connection.driver_class", DRIVER );
  // Inject dbName into connection url string.
  props.put( "hibernate.connection.url", String.format( URL, dbName ) );
  props.put( "hibernate.connection.username", USER );
  props.put( "hibernate.connection.password", PASS );
  
  // Note that DriverManagerConnectionProviderImpl is an internal class.  However, rather than creating
  // a ConnectionProvider, I'm using it for simplicity's sake.
  // DriverManagerConnectionProviderImpl obtains a Connection through the JDBC Driver#connect
  DriverManagerConnectionProviderImpl connectionProvider = new DriverManagerConnectionProviderImpl();
  connectionProvider.configure( props );
  return connectionProvider;
}
org.hibernate.engine.jdbc.connections.internalDriverManagerConnectionProviderImplconfigure

Popular methods of DriverManagerConnectionProviderImpl

  • <init>
  • stop
  • buildCreator
  • buildPool
  • closeConnection
  • getConnection
  • loadDriverIfPossible
  • isUnwrappableAs
  • unwrap

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JTextField (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best plugins for Eclipse
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